我正在尝试在wordpress帖子上提供一个链接,该链接将引导用户访问具有相同自定义字段的其他帖子的存档视图。
换句话说,类似于get_author_posts_url
,但get_customfield_posts_url
。
提前致谢!
答案 0 :(得分:0)
Wordpress不提供此功能,您需要对此进行编码。
/*
This will be your home work:
1. You need a page with a custom template
+ query var that returns the value of the custom field
+ custom loop that (you may use meta_query) finds posts
with the same custom field value
2. make function to convert the custom field
to a custom permalink may be.
http://example.tld/my_page/?custom_field=custom_field_value