Results 1 to 2 of 2

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

  1. #1
    hex
    hex is offline Unknown Net Builder
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    1
    Thanked 3 Times in 1 Post

    Wordpress - How to put something only on the Index page

    Hi,

    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 domain.com/page/2 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:

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

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

  2. #2
    hex
    hex is offline Unknown Net Builder
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    1
    Thanked 3 Times in 1 Post
    Figured it out:

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

  3. Thanked by:

    Aquarezz (19 May, 2009), javanx3d (20 May, 2009), Will.Spencer (20 May, 2009)

Similar Threads

  1. Replies: 6
    Last Post: 28 December, 2010, 06: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, 21: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

Bookmarks

Posting Permissions

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