• Resolved LasseMT

    (@lassemt)


    Hi guys!

    I want my title to show only on the first page of the post.

    Im using the <!--nextpage--> quicktag to divide my post in to multiplie pages and want the post title to only display on the first page.

    I thought i could use is_paged() but in the codex it says:

    This refers to an archive or the main page being split up over several pages and will return true on 2nd and subsequent pages of posts. This does not refer to a Post or Page whose content has been divided into pages using the <!–nextpage–> QuickTag.

    How should I do this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • you could use the global variables $page (and $numpages);
    or get_query_var('page')

    examples:

    <?php if( !get_query_var('page') ) the_title(); ?>

    or

    <?php global $page; if( $page <=1 ) the_title(); ?>

    Thread Starter LasseMT

    (@lassemt)

    Thank you alchymyth!

    I used the global variables method because I used the variables earlier to show the pagination echo 'Page '. $page .' of '. $numpages .'';

    Thread Starter LasseMT

    (@lassemt)

    Problem solved.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Title on posts divided into pages’ is closed to new replies.