mgsisk / webcomic

Comic publishing power for the web. Turn your WordPress-powered site into a comic publishing platform with Webcomic.
http://wordpress.org/plugins/webcomic
GNU General Public License v2.0
110 stars 29 forks source link

Can I only display the sidebar on homepage? #297

Closed Mastara closed 6 years ago

Mastara commented 6 years ago

Hi everyone, Sorry if this is a silly question... This is the website (https://oglindacomics.com/) I would like to make it so that the sidebar is only displayed on the homepage, and not on custom post types. https://oglindacomics.com/portfolio/childrens-play-ileana/ I have managed to apply the full page with template on all pages, except the archive (where the sidebar doesn't bother me) and the custom post types (Portfolio Projects, Jetpack). Some google searching suggested that my best chance is creating a Post Type Template, but that is a bit above my level of expertise, so I figured, disabling the sidebar everywhere but on the homepage should do the trick... Any ideas how I could achieve this? Thanks in advance!

mgsisk commented 6 years ago

Hey @Mastara, apologies for the late reply; this is definitely not a silly question! If you really only want the sidebar displayed on the homepage, I would switch Inkblot to the No sidebars layout, which should remove the sidebar completely.

To get the sidebar back on the homepage, start by opening Inkblot's sidebar.php file and changing line 14 from this:

<?php if ('one-column' !== get_theme_mod('content', 'one-column') or is_customize_preview()) : ?>

to this:

<?php if (is_home() or 'one-column' !== get_theme_mod('content', 'one-column') or is_customize_preview()) : ?>

That should get the primary sidebar showing up on the homepage. To get it styled properly, add the following to the Additional CSS section of the customizer:

.sidebar1 {
  width: 25%
}

.home .sidebar1 {
  display: block;
}

main {
  width: calc(75% - 2px)
}