Questions tagged [rewrite-tag]

The tag has no usage guidance.

14 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
1answer
535 views

Regex in add_rewrite_tag not accepting OR operators?

I am trying to add a custom field to the post permalinks by using a combo of add_rewrite_tag and applying a post_link filter. What I am aiming for is something like this: http://example.com/%...
2
votes
0answers
183 views

What add_rewrite_tag()'s RegEx matches against?

I'm trying to figure out wether I can specify the position of the string to match (i.e. immediately after the domain) to reduce the chances of matching something else, but I don't even know what the ...
1
vote
0answers
31 views

Custom permalink leads to index page

I have a custom post type named patch and custom permalink structure: www.site.ru/patch/%version_id% I managed to replace %version_id with actual version code with this code: add_action('init', '...
1
vote
1answer
121 views

Enpoint Not Found in Rewrite Tag Permalink

I'm trying to make an XML feed show nice and pretty permalinks rather than showing query strings. The problem is I can't get my /products/ endpoint to show up when trying to process my custom rewrite ...
1
vote
0answers
65 views

404 error using Meta for Permalink rewrite

I'm trying to rewrite my permalinks using meta data from my post. The permalink rewrite works fine but I'm getting the 404 error when I try to view the post. Could someone offer a clue as to why this ...
0
votes
0answers
12 views

How to Select post parent for CPT from another post type?

I'm developing a Sports website, covering cricket football, etc. The goal is: .pk /cricket (Landing page) .pk /cricket/ipl (IPL Landing Page) .pk /cricket/ipl/year (IPL Landing Page by ...
0
votes
0answers
32 views

How to add a custom permalink structure tag?

I'm trying to add a new %taxonomy-name% tag to Custom Structure in /wp-admin/options-permalink.php. I have registered a custom taxonomy called company, and I noticed that I can use a tag named as ...
0
votes
0answers
51 views

add_rewrite_tag broke permalinks that doesn't use that specific tag

I have a custom post type that I'd like to have a permalink slug based on its taxonomy. All the posts of this CPT have one, and only one, term always marked on this specific taxonomy. That's my code: ...
0
votes
0answers
22 views

Custom rewrites for tabs on a page

I have a Page Template, page-services.php, which displays content in various tabs. The page's URI is currently example.com/services. I want each tab to have its own permalink so that visiting a URI ...
0
votes
0answers
44 views

a way to support totally different url structure

I need to support permalink URL structure like: http://example.com/adult-course/newyork/language-course/english/standard http://example.com/adult-course/newyork/language-course/english/profi http://...
0
votes
0answers
53 views

Custom Rewrite Tag Structure

I am pondering over this intriguing question and I have yet to find an answer. I need to add my own Custom Structure Tags for my cpts. Extract fromt he link above: %year% The year of the post, ...
0
votes
0answers
82 views

URL Rewrite for CPT single posts

I'm struggling with Wordpress' rewrite function I have the following URL structure http://example.com/album/test-7/ 'album' is the slug for the CPT single page 'test-7' is the slug for the CPT post ...
0
votes
1answer
890 views

Passing variables in the permalink structure on a custom post type

I have a structure like this for my custom post types: domain.com/member/member-name/book/book-name Basically, I have a custom post type of member, and the member-name is the post. What I want to do ...
0
votes
1answer
90 views

Custom Taxonomy in Permalink from post type

I am using custom post types and custom taxonomies for that post type. This snippet currently sets the permalinks for the post type: 'rewrite' => array('slug' => 'myrewritebase'), I am ...