WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. jwburnside
    Member
    Posted 4 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.

    JW

  2. jwburnside
    Member
    Posted 4 years ago #

    OK, I got it. There is a function for getting the post type, whether it is a page, post, draft, etc:
    http://codex.wordpress.org/Function_Reference/get_post_type

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.