Results 1 to 2 of 2

Thread: Wordpress - How to put something only on the Index page

  1. #1

    Wordpress - How to put something only on the Index page


    Sorry if it's the wrong subforum... didn't know where else to put it. I'm having an issue with WP, and I need your help.

    How to add some text in the index.php file so it's displayed ONLY on index page? I add it normally in the file, but it shows it also on and 3, and so on, so I'm having a problem with duplicate content. I want the text only to be displayed on the homepage, and I can't do it by adding through Wordpress.

    Is there a command in PHP that can solve my problem? I tried this:

    <?php if ( is_home() || is_page() ) { ?>
    <?php } ?>
    But it doesn't work.

    Help guys, I need it urgently. Thanks a lot!

  2. #2
    Figured it out:

    <?php if(is_home() && $post==$posts[0] && !is_paged()) { ?>
    <?php } ?>

Similar Threads

  1. Replies: 6
    Last Post: 28 December, 2010, 07:32 AM
  2. wordpress custom registration page ?
    By SonnyCooL in forum Wordpress
    Replies: 2
    Last Post: 27 April, 2010, 19:48 PM
  3. Replies: 8
    Last Post: 6 April, 2010, 07:08 AM
  4. Wordpress Page Help
    By Sami4u in forum Wordpress
    Replies: 11
    Last Post: 19 December, 2009, 22:50 PM
  5. Wordpress Front Page Help
    By Sami4u in forum Blogging
    Replies: 9
    Last Post: 15 October, 2009, 19:02 PM

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts