• Afternoon Errybody,

    I’m trying to make my theme work well with a webcomic i’d like to publish,
    I’m using a custom theme I built myself to do this, the column I styled works well with blog posts and articles however its too thin to support a comic strip or full sized comic page.

    In this case should I post format to create a wider column’d post type and then exempt it from my homepage and archive listing? If I do do this how would I get the sidebar to not appear? (it was the reason the column was too thin)

    Also the issue I have with navigation in the webcomic,
    I’d like the last post, first post, next post latestpost buttons to only link to posts in the same category(s) so as to keep it consistent.

    Would this work?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Regarding the no sidebar for post format.

    Suppose your sidebar.php looks like this
    http://themes.trac.wordpress.org/browser/twentytwelve/1.1.1/sidebar.php

    Suppose we are doing thing for “aside” post format.

    Just add in the if ( has_post_format( 'aside' ) ) condition

    <?php if ( is_active_sidebar( 'sidebar-1' ) && if ( has_post_format( 'aside' ) ) ) : ?>

    And body_class() already has the single-format-aside class.

    Thread Starter mot13

    (@mot13)

    So I would be adding this code to the sidebar.php or function.php?

    That would replace the #L13 of that sidebar.php supposing you do the same as in Twentytwelve which is kind of how it is in general.

    And you can also make use of the body class which already includes post format class by default.

    So you got the logic not to output the sidebar’s markup, along with class as a selector in CSS to extend the width.

    Thread Starter mot13

    (@mot13)

    Oh I see I think but its still a bit confusing. My apologizes Im not used to this vocabulary.

    So this creates another condition for the sidebar to appear? But I actually want the sidebar to appear in all conditions unless the there is a post with (using your example) the post format “aside”. Were we thinking the same thing?

    Were we thinking the same thing?

    Yes.

    But the above code is wrong, the second if should be the !

    Use this instead.

    <?php if ( is_active_sidebar( 'sidebar-1' ) && ( ! has_post_format( 'aside' ) ) ) : ?>
    Thread Starter mot13

    (@mot13)

    Ah, Thank you very much I’ll try this out

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Removing Sidebar if post formats (webcomic help?)’ is closed to new replies.