143 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • United States
cramdesign says

How do you get the link to the blog url when using a static home page? Something like: get_bloginfo(‘blog’) but that is not in the cards… thanks.

1152 posts
  • Interviewed on the Envato Notes blog
  • Won a Competition
  • Halloween Competition Winner
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 50 000 and 100 000 dollars
  • Referred between 100 and 199 users
  • Bought between 1 and 9 items
  • United Kingdom
iKreativ says

How do you get the link to the blog url when using a static home page? Something like: get_bloginfo(‘blog’) but that is not in the cards… thanks.
<?php echo bloginfo('url'); ?>/blog/
http://codex.wordpress.org/Function_Reference/bloginfo

-Scott

143 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • United States
cramdesign says

<?php echo bloginfo('url'); ?>/blog/

That only works if you name your blog page “blog”. How do you get it dynamically?

143 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • United States
cramdesign says

Hard to believe that there isn’t a code for this. Best I can find so far is:

if( get_option('show_on_front') == 'page') {
    $posts_page_id = get_option( 'page_for_posts' );
    $posts_page = get_page( $posts_page_id );
    $posts_page_title = $posts_page->post_title;
    $posts_page_url = get_bloginfo('url') . '/' . get_page_uri( $posts_page_id );
}
else $posts_page_title = $posts_page_url = '';

It seems that there should be a better way.

3363 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 50 and 99 items
  • Referred more than 2000 users
  • Has been a member for 3-4 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark Volunteer moderator says

How about just

<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>
143 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • United States
cramdesign says

<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>

Well that seems easy now. Perfect. Thanks!

3363 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 50 and 99 items
  • Referred more than 2000 users
  • Has been a member for 3-4 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark Volunteer moderator says

You’re welcome :)

31 posts
  • Has been a member for 2-3 years
beiker says

Thanks! Works great here too.

by
by
by
by
by
by