143 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in 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.

1504 posts LoveThemes
  • Has referred 100+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 1+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
LoveThemes 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
  • Has been part of the Envato Community for over 5 years
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in 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
  • Has been part of the Envato Community for over 5 years
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in 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.

3473 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Moderator says

How about just

<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>
143 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in United States
cramdesign says

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

Well that seems easy now. Perfect. Thanks!

3473 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Moderator says

You’re welcome :)

31 posts
  • Has been part of the Envato Community for over 2 years
beiker says

Thanks! Works great here too.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by