I want to add some content (slider) only on the home page. I don’t want it to apear on the other pages. I am trying following:
<?php if(is_home()) { ?>
<div>
...
<div>
} ?>
But the content still appears on the second page (in pagination). How can i show some content to homepage only, so that id does not appear on second page? Thanks.
http://codex.wordpress.org/Conditional_Tags
The following lines should speak for themselve:
Have you tried
<?php if(is_front_page()) { ?>
I believe this is for using with sites that use a static home page.I always use home.php instead of index.php if I want a completely different home page than the other pages.
I put this code in just before The Loop on home.php:
<?php query_posts('cat=X&showposts='.get_option('posts_per_page')); ?>
where cat=X is the category ID of a category I created and usually call Homepage or Frontpage.
Then on the index page place this code:
<?php query_posts($query_string . '&cat=-X'); ?>
before the loop where &cat=-X is the same ID of your Homepage category. Notice the minus sign.
Now just pick the Homepage or Frontpage category for the posts you want only on the home page.