The add-rewrite-rule tag has no wiki summary.
2
votes
0answers
39 views
How to change the matches in add_rewrite_rule
One of the examples using add_rewrite_rule function in wordpress is
add_rewrite_rule('^nutrition/([^/]*)/([^/]*)/?','index.php?page_id=12&food=$matches[1]&variety=$matches[2]','top');
I can ...
0
votes
1answer
38 views
Rewrite custom post type url's adding meta box values
I've got these custom post types (CPT) and meta boxes:
Movies (CPT)
Genre (Meta box)
Genres (CPT)
If one movie is called Die hard then I want the permalink to be:
/genres/action/die-hard
This ...
1
vote
1answer
49 views
Adding paged query to custom URL rewrite
I have set up the following to create 'pretty' post type and category permalinks:
function kdev_add_category_rules() {
$post_types = array(
'kdev_photos',
'kdev_videos',
...
1
vote
0answers
25 views
How to pass url as a parameter in a add_rewrite_rule
I am building a plugin which relies on passing the url as a GET parameter. Now, I am trying to prettify the links by using rewrite rules but am stuck.
What I have now:
function ...
0
votes
1answer
28 views
Wordpress Rewrites - How can I pass a variable to Custom Post Type?
I'm looking for a wordpress rewrite that will let me pass a query var. I have a custom post type that produces urls like this:
example.com/custom-post-slug/custom-post-title/
my goal is to have
...
1
vote
0answers
45 views
Rewriting single post url; add_rewrite_rule problem?
I have to customize single post permalink (the structure of the permalink) if posts have a certain value in a certain custom fields.
I use the filter post_link to change permalink when needed, and ...
0
votes
0answers
60 views
permalink and add_rewrite_rule - error 404
I'd like to have comments in a separate page with a dedicated template only for posts in a specific category (slug shops). Example: mysite.com/post-incatshops --> mysite.com/post-incatshops/comment
...
0
votes
0answers
35 views
Adding in Custom Directory/Path in URL Without Effecting Permalinks
After several tries of piecing together different forms of add_rewrite_rule() and .htaccess edits, I have not been able to find a solution that works. I want to add in a custom directory to a ...
0
votes
0answers
31 views
Permalink of Custom Post Type
I am trying to create a custom post type called an 'event' and have it's permalink structure be as follows:
www.domain.com/events/238
where 238 is the post ID. However, when I navigate to the page, ...
0
votes
1answer
34 views
What is the proper way to use add_rewrite_rule to remove the (question mark)?
I have a page called "People" with a custom template that takes in a variable called name:
example.com/people/?name=FirstLast
What I want is this:
example.com/people/FristLast
I know I need to use ...
0
votes
0answers
42 views
Hierarchical Custom Post Type Permalinks, %postname%, Rewrites, Permastructs, Oh My
First go at programming with WordPress, I am trying to use custom post types (CPT) to organize 'Log' 'Entries' by 'Console'. So it's a one-to-many relationship between Consoles and Logs, and ...
0
votes
1answer
35 views
Custom Rewrite Problem
I'm creating some custom rewrites using the code below. Everything works fine, as far as urls such as this:
example.com/reviews/showname
Tells my theme to use the special archive page and passes ...
0
votes
1answer
36 views
why does add_rewrite_rule refresh and loose url variables
I am using:
add_action( 'init', 'add_author_rules' );
function add_author_rules() {
add_rewrite_rule(
"support/([^/]+)/?", "index.php?category=$matches[1]", "top");
}
in the ...
0
votes
0answers
32 views
Complex regex to add_rewrite_rule
I'm making a plugin and I need to get the URL stay that way:
/user/user-name/musics/music-category-slug/page/1
Real example:
/user/mike-yoles/musics/rock/page/1
.
user/ => post_type ( I ...
3
votes
3answers
172 views
rewrite_rule() not preserving the query string
We have added a custom rewrite_rule to our site to allow for a pretty inbound link to be parsed and handled properly. Links are constructed as domain.com/meetings/faculty/someIDnumber
add_action( ...
1
vote
1answer
64 views
Custom Rewrite Rules
I am developing a plugin, the goal of which is to allow for a bookmark-able, pretty permalink search engine on a single page. To do so, I am using WP's rewrite rules to allow for the ...
0
votes
1answer
52 views
Canonicalization + Custom Post Types not working as expected
I have an issue with Canonicalization where on Custom Post Types say for example:
/custom-post-type/{post_id}/fake-post-name/
is loading up but not redirecting to :
...
0
votes
0answers
83 views
add_rewrite_rule custom permalink structure
I'm trying to create a new rewrite rule inside functions.php through I can rewrite URL for specific post
ie: let's imagine there's a category which name is xyz.
This is my code:
function ...
0
votes
2answers
46 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 ...
0
votes
2answers
59 views
URL rewrite breaking pagination
I have been reading around and cannot seem to figure this out.
Everything is working fine except that pagination seems to not work, I am adding a second rewrite rule, shouldn't this fix that?
I can ...
0
votes
1answer
50 views
Wordpress Rewrite Rule
I have a standard page setup at http://mysite.com/mypage/
I'd like to setup a rewrite rule in my theme functions that takes any URLs such as:
http://mysite.com/mypage/helloworld/ <-- Currently ...
0
votes
1answer
33 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 ...
0
votes
1answer
67 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
...
2
votes
2answers
73 views
Rewrite numeric ID parameter for hierarchical custom post type
I've been banging my head against a wall on this one for a while but I'm not quite sure from all the tutorials I read how to see why this isn't doing what I expect.
I have a page called ...
3
votes
2answers
157 views
Custom post type 404s with rewriting even after resetting permalinks
I created a custom post type, of which the (simplified) arguments are:
register_post_type(
'Event',
'public' => true,
'rewrite' => array( 'slug' => 'eventy'),
'has_archive' ...
0
votes
1answer
42 views
Monkey Man Rewrite Analyzer says my rule will trigger but it doesn't [closed]
I installed Monkey Man Rewrite Analyzer, i got a rule installed, it shows in the list, if i test it with monkey man it says it will fire but it doesn't in reality, whats wrong?
add_action('init', ...
0
votes
1answer
205 views
How to redirect image attachment to its original post
I'm making a slider that is getting images from attachments in the post. I am trying to rewrite the url for the post so that if someone pastes the direct url to the attachment, it'll go the post ...
0
votes
2answers
91 views
404 Error On Custom Taxonomy Pages 2, 3, etc
I've been reading a bunch of posts about this with no luck so far. I can't seem to figure out what is the problem.
I have the following:
Custom Post Type: Sermons
Custom Taxonomy: Series
My urls ...
0
votes
2answers
101 views
How do I make WordPress revise an .htaccess file a certain way?
I've learned just a slight bit with WordPress Rewrite API -- just enough to add another rewrite rule for a plugin. The plugin works if installed in the root, but I'm finding that if one installs ...
1
vote
0answers
37 views
Customise particular RSS permalink
From my old static website, I want to preserve some URLs like the RSS Feed one.
My feed URL is http://traduction.bainslesbains.com/actualite-russe.xml and I want to redirect it to the category feed ...
1
vote
1answer
93 views
Custom rewrite rule is not picked by Wordpress
I am trying to create a custom Rewrite URL something like
function add_my_rule() {
global $wp;
$wp->add_query_var('state');
$wp->add_query_var('state_destination');
...
1
vote
1answer
135 views
Re-write specific custom post type category URL to go to another page
I know this general question has been asked before (like here and here), but the problem is with my limited experience, I cannot get the results I need looking at other people's code.
So here's my ...
0
votes
1answer
83 views
Rewrite rule to redirect to a particular filename.php
I'm using the Monkeyman Rewrite Analyzer plugin (http://wordpress.org/extend/plugins/monkeyman-rewrite-analyzer/) I want to write a rule that will be take a URL (that is specified in the user's accnt ...
0
votes
1answer
54 views
Wordpress post-type create url rewriting
i create a new post-type in wordpress.
The new post-type is called work.
I want to customize the link when the user click "details button".
The link is work/post_id/postname
I have a trouble to ...
0
votes
0answers
41 views
rewrite rule with a slug and id [duplicate]
Possible Duplicate:
How to create custom post type subpage with sub-posts on it?
Okay, this is related to another post I made, but much more focussed.
I have two custom field types, ...
0
votes
1answer
158 views
Redirect old query string urls to new SEO urls
I had urls like example.com/?area=new-york. area is a custom taxonomy. I had to change the urls to example.com/new-york. I want to do a 301 to new urls if previous urls are accessed. and I want Google ...
1
vote
1answer
97 views
resolve /author/ to a page or archive (of all authors) template
I know how to query the users and create a list of authors and can accomplish this in a page template, much like is described here:
Authors Page : A page of authors
my question is then....
is there ...
1
vote
1answer
156 views
Need to add rewrite rule that adds in additional information about the post to url
A have a post type for venues which have the attributes title, state, and suburb. Currently using the default WordPress permalinks I get the following format:
mysite.com/venue/{title}
However, I ...
2
votes
2answers
227 views
Adding meta values to permalink
I have publications and I want to simply add year and month to the permalink. Currently the year and month of publication is added to the post as a meta value. I've set up publications as a custom ...
1
vote
0answers
195 views
query_vars in plugin not working?
I have a problem writing a plugin for wordpress.
First, I register a new query_var and add a new rewrite rule:
function nng_users_query_vars( $vars ) {
array_push( $vars, 'nng_users' );
...
1
vote
0answers
55 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
97 views
Struggling with add_rewrite_rule
I've read this:
Wordpress redirection to get url friendly
That led me to this:
1) wp.tutsplus.com/tutorials/creative-coding/the-rewrite-api-the-basics/
2) ...
1
vote
0answers
85 views
Evaluating a external rewrite rule before internal wordpress rewrite rule
I am been plucking out my hairs since last few days trying to solve this problem:
I want to convert my urls from format
http://example.com/prodsearch/category/tag1-tag2-tag3-tag4
to
...
1
vote
1answer
297 views
Optimal code for two add_rewrite_rule's
I have two custom rewrite rules; after reading allot of great posts here I found a way to make them work.
The question is this:
Is there a way to merge this code? I'm not sure that the way I wrote it ...
1
vote
1answer
75 views
Different rewrite rules for taxonomies and cp in multisite?
I´m making a multilingual site with multisite and I`m wondering if you can specify different rewrite rules for taxonomies and custom posts for the different sites, that are using the same theme. Maybe ...
2
votes
2answers
214 views
add_rewrite_rule and attachment_id
Im trying to add a rewrite rule to make this
mysite/?attachment_id=106
view like this
mysite/series/106
Ive looked evetywhere in this site and others and its very confuse because there are lots of ...
0
votes
2answers
248 views
custom wordpress rewrite
I am trying custom rewrite for following url...
http://www.domain.com/lp/1
and it would be parsed using
lp.php?p=1
I have tried following...
add_action( 'init', 'aagt_rewrite_add_rewrites' );
...
0
votes
1answer
114 views
Problems with rewrite rule
I realy cant to figure this out.
What i want to do, is this URI http://www.hotels-lithuania.net/index.php?page=76&type=hotels&id=1 transform to http://www.hotels-lithuania.net/item/hotels/1.
...
4
votes
3answers
497 views
add_rewrite_rule not loading correct page nor getting variables
I've trying to get a showreel title and video id into an URL that can then be accessed by the page.
i have the two in the same URL and it either doesn't work or only one comes in. Currently the page ...
1
vote
1answer
107 views
Rewrite ugly URL to clean URL
Im trying to go from:
http://www.example.com/product?level1=value1&level2=value2&level3=value3&level4=value4
To:
http://www.example.com/product/value1/value2/value3/value4
Sometimes ...