Customize tag page that displays pages and posts (2 posts)

  1. jwburnside
    Posted 6 years ago #

    Hey everyone, I built a simple tag page that displays both pages and posts since I am also using the Page Tagger plugin.

    The only problem that I am having is that I need to disable the titles on all of the pages that are displayed, but not the posts. Like this:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    //if the output is a post
    <h1 class="phead"><?php the_title(); ?></h1>
    //if the output is a page
    <h1 class="phead"></h1>

    Anyone have any ideas? Any help would be appreciated, thanks.


  2. jwburnside
    Posted 6 years ago #

    OK, I got it. There is a function for getting the post type, whether it is a page, post, draft, etc:

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.