Last active
April 18, 2017 12:37
-
-
Save robbens/a1175c829314dc819ff4e4fd422506ae to your computer and use it in GitHub Desktop.
Small function to get the page set to work as blog in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gets the blog page set in Settings > Reading. | |
*/ | |
function rn_get_blog_page_url() { | |
if ('page' == get_option('show_on_front')) | |
return get_permalink(get_option('page_for_posts')); | |
return home_url(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment