homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / WordPress
Forum Library, Charter, Moderators: lorax & rogerd

WordPress Forum

wordpress is home/frontpage functions

5+ Year Member

Msg#: 4357176 posted 4:00 pm on Jul 18, 2011 (gmt 0)


I've found the if_home and if_front_page to be potentially useful..but..also found that it causes problems.

Current setup is that in the index.php file I have some static content followed by the list of blog posts, limited to only 1.

When clicking on "older posts", it goes to /page/2/ as the URL, but its basically a repost of the home page.

I then did this:

if ( is_front_page() ) {
} else {

And also surrounded the static content in a similiar way

if ( is_front_page() ) {
// static content
} else {
// nothing at all

I also tried it with is_home function, but neither work. I just get a repeat of the home page on a different URL and the most recent post rather than a list of the 10 recent posts. Anyone know why and how to get it to work?




WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 4357176 posted 3:08 pm on Aug 31, 2011 (gmt 0)

surrealillusions, I'm going to move this to the WP forum where perhaps somebody can assist.


WebmasterWorld Administrator lorax us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Msg#: 4357176 posted 1:06 pm on Sep 1, 2011 (gmt 0)

Well first off, I'd recommend you don't edit index.php as WordPress uses it for so many different things. Edits should be done using the Theme's functions.php file or create your own theme to suit.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / WordPress
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved