• Hi,

    I’m working on a magazine website where the feature articles are divided up into pages (because they’re very long).

    On each feature there is a standfirst and image – however I would like to only display these on the fist page and not on the subsequent pages.

    Is there any way to do this? My code for the image and standfirst look like this (both located on single.php):

    <?php if ( (in_category(14)) OR (in_category(24)) OR (in_category(38)) ) {echo c2c_get_custom('Image URL', '<img src="', '" width="582" height="200" alt="main feature image" /><span class="clear-space5"></span>'); } ?>

    <?php echo c2c_get_custom('Standfirst', '<div class="standfirst">', '</div>'); ?>

    So ideally something that could say if this is a paged post and is more than page 1 then dont display the following.

    If anyone can help that would be much appreciated. I’ve tried using

    if( !is_paged() )

    but that doesn’t seem to work. I also read that this could be used:

    if( get_query_var('paged') < 2 )

    But I’m stumped how to implement that for specific elements on a post.

    I’m using wordpress as a CMS and adding this to the features would be great.

    Thanks!
    Alex

    PS. if any wants to see the site it should be live on https://www.huckmagazine.com after Wednesday 9th January.

  • The topic ‘Paged posts – conditional tag so elements only show on 1st page’ is closed to new replies.