Questions tagged [rewrite-tag]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
26 views

Get wordpress installation folder

I'm writing a rewrite rule, accompanied by two additional rewrite tags, which (the tags) must apply only on a specific page. In the past, when I had to do something similar, I had done it like this: ...
user avatar
  • 121
0 votes
0 answers
24 views

How to change an existing wordpress page rewrite rule?

I'm new here and I don't have mach coding experience. I've created a new page layout the data there is taken from a text file and the name of the file is passed in a parameter so for example the url ...
user avatar
  • 1
0 votes
1 answer
34 views

Custom Post Type posts, conflict with posts after add_rewrite_rule to top

I had cpt with taxonomy like this: add_action('init', 'zsz_add_posttype'); function zsz_add_posttype() { // -- Taxonomy CATEGORIES - [category-a] [category-b] [category-c] [...] ...
user avatar
0 votes
0 answers
16 views

wordpress path generation from rewrite rule

I have set a custom rewrite rule. The url gets parsed and loads the correct page. When the same page is added in the menu editor, it does not generates the different path. I want that my same rewrite ...
user avatar
  • 101
0 votes
0 answers
48 views

add_rewrite_rule() issue with parent/child/child page

I have a parent/child and another parent/child/child pages. I have 2 separate page templates for both pages and the following add_rewrite_rule() code in place: add_rewrite_rule( '^user/dashboard/([^/]*...
user avatar
  • 101
0 votes
1 answer
26 views

how to change the title of tag page?

what is the correct function or hook to change the title of tag page ? I want to insert something at the beginning the tag title page.
user avatar
0 votes
0 answers
24 views

add_rewrite_rule - suddenly stopped working (wordpress)

I have a url example.com/sample-page/?amount=567 It initially worked ok, it redirects to: example.com/sample-page/567 But after few days, i noticed its not working any more. Its now redirecting to ...
user avatar
0 votes
1 answer
61 views

Combine multiple CPT names to create valid permalinks

I have three different Custom Post Types: Company Employee Project They are connected with ACF relationship fields so as the Company can have multiple Employees and each Employee can have a project ...
user avatar
0 votes
0 answers
64 views

How to build a achieve page for a custom CPT with multiple taxonomy button filter

This is an extended question from Permalink for CPT with taxonomy I am building a website that has a CPT and a few custom taxonomies. Each single CPT post is basically "a question" for ...
user avatar
  • 35
0 votes
1 answer
19 views

Having a problem with rewrite_rules and rewrite_tags - url not rewriting properly and query var missing

I am almost tearing my hair out trying to get to grips with the Wordpress rewrite rules and tags. From within a plugin, I've created a page called 'childpage', it is the child of another page called '...
user avatar
0 votes
0 answers
20 views

Multiple Taxonomy Items for Separate URLs

Can anybody just let me know if this is possible for the start? I have Custom Post Type "Recipes" and a Custom Taxonomy "Type", which consist of multiple items: breakfast, snack, ...
user avatar
1 vote
1 answer
364 views

Can't get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together

Problem specification I'm implementing a website that is meant to host podcast shownotes and transcripts, and so I want custom permalinks and shortlinks for the webpages: Permalinks of the form /...
user avatar
  • 113
1 vote
0 answers
34 views

Rewrite URLs - Custom Post Type - Post Slug, Taxonamy Slug

Am using a third-party plugin for listing schools. Custom Post Type = school Custom Post Taxonomy 1 = school_type (eg. values = Primary, Intermediate) Custom Post Taxonomy 2 = school_location (eg. ...
user avatar
  • 123
2 votes
0 answers
41 views

How to restore WP 5.4 behaviour where a numeric string could added to each page URL and parsed as "page" in WP 5.5?

In WP 5.4.x, I was able to add a number to the URL for any page, post, etc. (incl. custom post types), which WP interpreted as the 'page' for a multi-page post, even if that page or post didn't ...
user avatar
0 votes
0 answers
79 views

Where to add add_rewrite_tag for trailing tilde?

Ive just been reading @gmazzap s reply about wordpress matching URLs with trailing tildes. and could do with some help please. As a coding newbie, I am not sure where to add his suggested code: ...
user avatar
  • 1
0 votes
0 answers
246 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: ...
user avatar
0 votes
1 answer
40 views

Create new URL structure for custom post types

I have 3 custom post types: development house_type room I have used ACF to build some relationships between these custom post types so development sits at the top and can have many house_types ...
user avatar
0 votes
0 answers
59 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://...
user avatar
  • 1,019
1 vote
0 answers
39 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', '...
user avatar
  • 125
1 vote
2 answers
1k views

How to add custom variable in url without redirect?

I'm trying to add a local variable to my URL. As an example I have this URL: mysite.com/my-page-name/ And I want to add 'en' variable into it and leave the page working properly: mysite.com/en/my-...
user avatar
3 votes
1 answer
598 views

Multiple values in a rewrite rule, is it possible?

I'm using url rewrites for a filter i'm building. The current solution works for one selected value. So if I select one type of dish like dinner, it goes to /recipes/dinner/. But what if I want to ...
user avatar
  • 55
1 vote
1 answer
118 views

Help with rewrite rules for two post types

I'm trying to setup two rewrite rules for two post types. Basically, the structure I want is this: site.com/app/course/xxxx/ => adds query_var course site.com/app/course/xxxx/theme/xxxx/ => adss ...
user avatar
1 vote
1 answer
151 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 ...
user avatar
  • 19.6k
4 votes
1 answer
4k views

permastruct for custom post type not working in one of four cases

I've created custom permalinks for various custom post types on a website. They all worked. Until recently I added another one, which I cannot get to work 8-o. The "company" struct is not working and ...
user avatar
  • 426
0 votes
0 answers
76 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, ...
user avatar
  • 476
1 vote
3 answers
4k views

add_rewrite_endpoint not working

I've been having looot of troubles with this function, I don't know what to do, because I tried everything. I have a custom post type, let's call it study. The url structure for it is http://...
user avatar
2 votes
1 answer
1k views

Permalinks, Rewrites, Get Variables, Oh My!

Ok, so I know it's a silly title, but it's exactly how I feel right now.. I've created some custom rewrites for WordPress and they work great, the only problem is that now I need to add pagination. ...
user avatar
0 votes
0 answers
100 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 ...
user avatar
1 vote
1 answer
8k views

Custom query_vars and parse_request on wp-admin

I've read this post http://wordpress.org/support/topic/query-vars-in-admin and although it's quite an old question, it suits me perfectly. I'm trying to accomplish what I already posted here: ...
user avatar
0 votes
1 answer
1k 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 ...
user avatar
0 votes
3 answers
980 views

Why isn't my rewrite rule working when there is no second parameter?

Here is my rewrite rule code: add_rewrite_rule('tides/([^/]+)/([^/]*)', 'index.php?page_id=4348&location=$matches[1]&month=$matches[2]', 'top'); add_rewrite_tag('%location%', '([^&]+)'); ...
user avatar
  • 113
0 votes
2 answers
2k views

WordPress Rewrite rule is not working

I am trying to create a rewrite rule for one of my custom page and here is the rewrite rule function add_my_rule() { global $wp; $wp->add_query_var('name_state'); $wp->add_query_var(...
user avatar
5 votes
1 answer
800 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/%...
user avatar
  • 61
2 votes
1 answer
2k views

Taxonomy Url with Custom post type prefix re-write rule

I have a taxonomy called Section and a Custom post type called Developments. What i need to achieve is a permalink on the taxonomy with custom post type prefixed: e.g: custom post type: development &...
user avatar
  • 153
0 votes
2 answers
959 views

Redirect taxonomy to custom template to list terms in taxonomy

I'm trying to adapt some code on calling a custom template via rewrite rule. I have a custom taxonomy called "state". I want to create an archive for the taxonomy, that lists all the terms in that ...
user avatar
0 votes
1 answer
155 views

Rewrite rule help for gallery plugin

I am writing a basic gallery plugin for WordPress. In the plugin users can mark images as favorites and there is a page where users can see their favorites. I want to setup some rewrite rules for the ...
user avatar
19 votes
1 answer
5k views

Using the Rewrite API to Construct a RESTful URL

I'm trying to generate rewrite rules for a RESTful API. I just want to see if there is a better way to make this work than having to write out every possible rewrite combination. Ok so I have 4 ...
user avatar
  • 1,199
0 votes
1 answer
457 views

Append custom parameter to taxonomy/term URI

I have a Custom Post Type named "Cars" and 2 Custom Taxonomies "Ferrari" and "Lamborghini". Each taxonomy has 2 Terms: "New" and "Used". These URIs work as expected: http://myhost/ferrari/new http://...
user avatar
  • 316
1 vote
0 answers
71 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 ...
user avatar
0 votes
1 answer
101 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 ...
user avatar
  • 1
3 votes
0 answers
200 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 ...
user avatar
  • 270
4 votes
2 answers
10k views

Rewrite Rules for Multiple (more than 2) Taxonomies

I am using woocommerce and have some 'product attributes' which are just a taxonomies. I have the following taxonomies: pa_color pa_material pa_style the pa_ stands for product attribute and it is ...
user avatar
0 votes
1 answer
1k views

why is are these rewrite_tags and rules not working?

im trying to get this to work for 3 different pages it was working fine with 1 rewrite, then when i added 2 more its not working for any of them. heres the code: function add_video_rewrite () { ...
user avatar
  • 135
0 votes
1 answer
198 views

help with rewrite_tag and rewrite_rule for custom page GET variables [duplicate]

Possible Duplicate: custom htaccess rewrite rule for page ok i made another post and i got pointed to the Rewrite API however, when i do print_r($_GET) on the page, it echos an empty array ...
user avatar
  • 135
4 votes
1 answer
2k views

How to filter custom post type archive by meta value

I have a problem where I'm trying to build a calendar plugin for a client. I'm having trouble getting a date based archive for the custom post type I'm using. I'm not too well versed in how the ...
user avatar
2 votes
1 answer
4k views

Prettified page URL w/ query var redirects to prettified page URL w/o query var

I have a page created (page ID 235) with a page template that will need to be passed a variable. I would like to pass this variable through the URL. My first attempt was to pass this with a GET ...
user avatar
  • 182
2 votes
1 answer
1k views

custom permalink/shortlink with base62 encoded post ID

I want my post-links to look like /%post_id62%_%postname%/ where %post_id62% is the post ID in base62 encoding (e.g. http://example.com/y9Rlf_test/) and my shortlinks to consist of /%post_id62% only (...
user avatar
  • 125
0 votes
1 answer
3k views

How to test custom rewrite rules /permalinks?

After much research, I think I can wrap my brain around WP's rewrite system. I would like to know, though, how to properly test rewrite rules to see if the right rule/tags is being used and the right ...
user avatar
1 vote
1 answer
673 views

404 Issue w/ Custom Post Type - using Meta for Permalink rewrite

I'm trying to rewrite my permalinks using meta data from my post. The permalink rewrite works- but I'm getting the 404 issue when I try to view the post. I've flushed by visiting the permalink ...
user avatar