ThemeForest

Link to Blog URL?

138 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 1 and 9 items
  • 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.

3 months ago
587 posts
  • Has been a member for 1-2 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • United Kingdom
  • Referred between 10 and 49 users
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

3 months ago
138 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 1 and 9 items
  • 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?

3 months ago
138 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 1 and 9 items
  • 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.

3 months ago
2094 posts
  • Has been a member for 2-3 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Grew a moustache for the Envato Movember competition
  • Most Wanted Bounty Winner
  • Community Moderator
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • United States
  • Referred between 500 and 999 users
sevenspark says

How about just

<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>
3 months ago
sevenspark is a moderator
138 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 1 and 9 items
  • United States
cramdesign says

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

Well that seems easy now. Perfect. Thanks!

3 months ago
2094 posts
  • Has been a member for 2-3 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Grew a moustache for the Envato Movember competition
  • Most Wanted Bounty Winner
  • Community Moderator
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • United States
  • Referred between 500 and 999 users
sevenspark says

You’re welcome :)

3 months ago
sevenspark is a moderator
31 posts
  • Has been a member for 0-1 years
beiker says

Thanks! Works great here too.

3 months ago
by
by
by
by
by