http://codex.wordpress.org/Function_Reference/wp_count_posts
for instance:
<?php
$count_posts = wp_count_posts();
$published_posts = $count_posts->publish;
if( $published_posts >= 3 ) {
echo '<a href="' . get_option('home') . '/">' . get_bloginfo('name') . '</a>'; }
?>
Thread Starter
Indent
(@indent)
Thank you so much.
I knew there would be a PHP wiz out there.
Thanks a lot! You made my day.
Thread Starter
Indent
(@indent)
@alchymyth;
One problem:
get_option('home')
displays my static front page.
Can’t find anything on how to make it display my blog page / page for posts.
I would really appreciate it if you could help. Thanks.
Thread Starter
Indent
(@indent)
What I mean is that in WP admin/Reading Settings one can set at static front page and a posts page, which I have done.
As I understand the conditional tag is_home
always refers to the posts page, while get_option('home')
refers to whatever the front page is; static or latest posts.
I just thought it might be a tag for the selected posts page as it is for the front page eg. get_option('home')
.
Hope this can help you help me. Thanks for your time.