[resolved] Help with conditional tags within single.php (2 posts)

  1. stylishjm
    Posted 3 years ago #

    So I'm using yootheme which is really annoying for custom post types as I cant seem to work out to create them without ending up with a blank unformatted page, so I'm attempting conditional tags within single.php to do the following:

    If page belongs to the wp e-commerce post type, hide the header, otherwise show it (as I need it for the blog section.

    '<?php if(get_post_type($post) == 'wpsc-product') {?>
    <div> derp, this is a single product page </div>

    <?php } else; {?>


    All the header stuff would be in here


    <?php }?>'

    When used, I can see the "derp, this is a single product page" only on my product pages which is great! However the header is still showing.

    If I were to manually delete the header section within this template, then it will obviously not show.

    Any ideas?

  2. stylishjm
    Posted 3 years ago #

    Nevermind, removed the semicolon after else, and it worked!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.