WordPress.org

Ready to get started?Download WordPress

Forums

How to Get WordPress Blog URL (2 posts)

  1. champoy186
    Member
    Posted 1 year ago #

    Here is the link of my site: http://elpolloinka.com/gardena/

    I would like to ask how can I get the main URL for Blog section. The page that contains all posts. I really don't know how to fix this.

    You suggestions are highly appreciated.

    Thanks

  2. vtxyzzy
    Member
    Posted 1 year ago #

    I think this will do what you want:

    <?php $postsPageId = get_option('page_for_posts');
    $url_parameter = ( $postsPageId ) ? '?p=' . $postsPageId : '';
    $url = get_home_url('/') . $url_parameter; ?>
    <a href="<?php echo $url; ?>">Our Blog</a>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags