WordPress.org

Ready to get started?Download WordPress

Forums

Adding multiple conditions for custom post types (2 posts)

  1. Thomas Griffin
    Member
    Posted 3 years ago #

    I'm kinda stumped on this one..

    I'm using custom post types on my website, and for one of my custom post types I don't want an author box to display. My custom post type functions like a portfolio. Basically what I want is that the author box show up on all is_single posts except for the portfolio is_single posts. Here is what I have in my functions.php file:

    function author_box() {
    if (is_single() && post_type_exists('folio')) {
    }
    elseif (is_single()) { ?>
    
    yada yada yada
    
    <?php }
    }

    This isn't working from what I can tell, so how I can I accomplish this with the conditional tags?

    Thomas

  2. Thomas Griffin
    Member
    Posted 3 years ago #

    Got it figured out.

    Didn't realize that is_singular could now target custom post types!

Topic Closed

This topic has been closed to new replies.

About this Topic