Pages AND Posts – want custom /home/ page & /blogs/ to list blogs
-
Hey there,
I’m using the 1 install of WP as a CMS to run my site (Pages), and a blogging engine (Posts) at /blog/.
What I’m after is a completely custom /home/ page, but every other page running off the same / similar template.
Under Reading settings I have both static pages set – Home and Blog. Based on what I have read this appears to be correct.
What I have trouble with is identifying the /home/ and /blog/ page in the PHP template.
I originally wrote something like:
<?php if ( is_home() || is_front_page() ) { include(TEMPLATEPATH . '/myhome.php'); } else { include(TEMPLATEPATH . '/body.php'); } ?>
… where myhome.php is a unique template specifically for the /home/ page (I don’t want the headers, and have slightly different CSS), and body.php is for every other page. Works wonders.
Until I click the /blog/ link.
This seems to load some cross of the /myhome.php template without the appropriate stylesheets. Can’t quite work it out, but it’s definitely falling into the is_home() || is_front_page() if statement. This makes sense, I guess? – I’ve set /blog/ as the front page.
I’m thinking there’s a correct combination of is_home(), is_front_page(), is_page(), etc. that should do this correctly for me.
Anyone successfully written a theme like this, or got some template suggestions, with a custom /home/ page and the /blog/ page simply listing the blogs like it should, and all other ./pages displaying correctly too?
Jason
- The topic ‘Pages AND Posts – want custom /home/ page & /blogs/ to list blogs’ is closed to new replies.