Opened 16 months ago

Last modified 15 months ago

#19902 new feature request

blog_url() and get_blog_url() template tags

Reported by: johnjamesjacoby Owned by:
Priority: normal Milestone: Awaiting Review
Component: Template Version: 3.3.1
Severity: normal Keywords: has-patch 2nd-opinion
Cc:

Description (last modified by johnjamesjacoby)

With usage of WordPress as a CMS increasing, the blog is not always the focal point. It would be great if there were template tags available to get the blog url, basically a wrapper for getting the options if it's set to a WordPress page, and defaulting to home_url( '/' ) if not.

Patched against r19759 (trunk)

Attachments (1)

19902.diff (1.5 KB) - added by johnjamesjacoby 16 months ago.

Download all attachments as: .zip

Change History (5)

comment:1 follow-up: ↓ 2   nacin16 months ago

Since we already have site_url(), let's try to pick a name that is less confusing. Perhaps blog_page_url() or something.

This might be a duplicate of another ticket, but I'm not locating anything.

comment:2 in reply to: ↑ 1   johnjamesjacoby16 months ago

Replying to nacin:

Since we already have site_url(), let's try to pick a name that is less confusing. Perhaps blog_page_url() or something.

This might be a duplicate of another ticket, but I'm not locating anything.

Agree the nomenclature gets increasingly confusing. Possible permutations:

  • get_/blog_url()
  • get_/blog_link()
  • get_/blog_permalink()
  • get_/blog_page_url()
  • get_/blog_page_link()
  • get_/blog_page_permalink()
Version 0, edited 16 months ago by johnjamesjacoby (next)
  • Description modified (diff)

I wrote a similar patch before finding this ticket, which covers pretty much everything I thought of. An additional idea I had was to return the last post if the blog uses a static front page but doesn't have a posts page set. In that case, I think the last post (if one exists) makes the most sense as their blog URL.

Note: See TracTickets for help on using tickets.