I want to embed links to the archive pages with specific search criteria. i.e Links to specific categories, links to specific authors etc etc
At the moment I am adding the links using anchor tags, but these will fail if the permalinks change
I want to embed links to the archive pages with specific search criteria. i.e Links to specific categories, links to specific authors etc etc
At the moment I am adding the links using anchor tags, but these will fail if the permalinks change
You must be logged in to post a comment.
WordPress can generate these, so you can too. You would need to use the same function that WordPress does.
For category it would be something like:
Similarly there is
get_tag_link()
and on deeper level they all really useget_term_link()
I didn’t play much with authors, but there is
the_author_posts_link()
and probably someget_
analogue.Category archives, author archives, date archives, etc will not experience permalink changes. If you’re using pretty permalinks,
http://yourblog.com/category/my-cool-category
will always present you with a list of posts frommy-cool-category
. Likewise,http://yourblog.com/author/mildfuzz
will always present you with a list of posts published bymildfuzz
.The only tricky part is if you want to display other information on the archive page (like an author bit for an author archive) … but there are tutorials available for that kind of work.