WordPress.org

Ready to get started?Download WordPress

Forums

Link to blog in template (10 posts)

  1. spaantje
    Member
    Posted 4 years ago #

    In your template you can use
    <?php echo get_option('home'); ?>
    To link to your homepage.

    If have made a template in which i use a static page as front page.

    Now i want to make a link to the blog page in my template (i have chosen a page for the post-page/blog in the backend)

    Is there a function that does that?

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    http://codex.wordpress.org/wp_list_pages

    the list pages shows a list of pages as links....i believe scanning the page, that you can exclude certain pages, or only include certain pages....maybe that sounds like what you trying to do?

  3. spaantje
    Member
    Posted 4 years ago #

    I already use that one for the menu.

    Thanks, But i don't think it's what i'm looking for.
    I can't look for the page that's displaying the posts.
    I can just in/exclude page id's.

    If that's the only way i can just use a hardcoded url.

    Any other suggestions?

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    Guess I'm confused as to what you need? You've selected a page that all your posts appear on.....so that page has a page id, so you would include that page....

    sorry if I'm misunderstanding you.....

  5. xdesi
    Member
    Posted 4 years ago #

    Edit: Just read what you mean,@RVoodoo he is looking for something which will pull the link of the blog posts page automatically, so if he changes the page the link will update also.

  6. spaantje
    Member
    Posted 4 years ago #

    That is correct.. But i want the template to be universal so that is still works without knowing the page id..

  7. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    ah hah...I follow now, that is something I'm not sure about

  8. xdesi
    Member
    Posted 4 years ago #

    How about bloginfo, depends on what settings you have for your WP URL and blog URL

  9. spaantje
    Member
    Posted 4 years ago #

    That's not working.
    get_bloginfo('url'); Points to the frontpage..
    But i can't seem to find the posts-page url.

  10. chuckmo
    Member
    Posted 4 years ago #

    I landed here looking for the same answer, but found it after digging around in the Codex.

    Try:
    get_page_link(get_option('page_for_posts'))

Topic Closed

This topic has been closed to new replies.

About this Topic