New Static Front Page, link to Blog Page
-
ok, so i really dig the static front page thing. i’m trying to find a way to make a link to the page of blog posts, and make it work universally, for the likely event that i release it as part of a theme. here’s what i’ve got so far:
$mytheme_frontpage = get_option('show_on_front'); $mytheme_page_for_posts = get_option('page_for_posts'); $mytheme_blog_page = get_post($mytheme_page_for_posts, Array_A); $mytheme_blog_url = $mytheme_blog_page->guid; ?> <a href="<?php if ( $mytheme_frontpage = page ) { echo $mytheme_blog_url; } else { bloginfo('home'); } ?>" title="home">Blog</a>
it works once. after that, the variables stop updating. so if i switch back to showing blog posts on the front, the link still goes to whatever static page i had previously defined.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘New Static Front Page, link to Blog Page’ is closed to new replies.