0

How can I find out if I am on the 1st page of my home page.

I have my page setup like below where I want to display the 1st 2 posts taking up full width. then the rest 1/2. But I want this behaviour on the 1st page only, how can I do that? What condition do I use?

1

I'm assuming that you're talking about the "home page" when you say "1st page only". Or are you talking about the first "paginated" page of your posts? If its the prior, you'd probably want to use the "is_front_page()" conditional if you're using a single page.php template.

Or maybe it'd be easier to make a "page-home.php" template and do some sort of new query of your posts...just for that page. Would that work?

  • Ok, I think also this helps. Also can you explain the difference between is_front_page() and is_home()? – Jiew Meng Feb 14 '11 at 6:57
  • Ok, so I solved the problem with is_front_page() && !is_paged() // for front page. It will be great if you can explain the diff between is_front_page() and is_home() – Jiew Meng Feb 14 '11 at 7:10
  • 1
    @jiewmeng: From the documentation: is_home() is the main blog page, the page that shows the newest blog posts. is_front_page() is the front page, which can be a static page instead of the posts page, when you change this under Settings > Reading > Front page displays. In that case, is_home() will be true for the page set as the Posts page there. – Jan Fabry Feb 14 '11 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.