• Resolved radovleugel

    (@radovleugel)


    To display certain information only on the index-page I insert the following code in header.php:
    <? if( is_home ()) {
    include(“info.php”);
    } ?>
    I am not totally satisfied with that, because I want to display this information only on index.php (index.php/page/1/) (and not on the following pages (index.php/page/2/, index.php/page/3/ etc.) With my code all the subsequent pages display the content of info.php.

    Is there a way to adapt <? if( is_home ()) {
    include(“info.php”);
    } ?> in order to display info.php only on index.php/page/1/?

    My knowledge of php is very basic…

    Your help is highly appreciated.

    Greetings,
    Rado Vleugel
    The Netherlands

Viewing 2 replies - 1 through 2 (of 2 total)
  • How about this?

    <?php
    if( is_home() && $_GET['paged'] <= 1 )
    {
    include('info.php');
    }
    ?>

    If that gives you weird results, you could also try this instead:

    <?php
    global $paged;
    if( is_home() && $paged <= 1 )
    {
    include('info.php');
    }
    ?>

    Thread Starter radovleugel

    (@radovleugel)

    Thanks a lot for resolving my problem. Your first suggestion didn’t gave weird results, but didn’t generate any results at all. Your second suggestion works perfect!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Different content on index.php/page/1/ & index.php/page/2/’ is closed to new replies.