The rewrite-rules tag has no wiki summary.
13
votes
1answer
9k views
Need help with add_rewrite_rule
SOLUTION
I've gone with Update 3 and have got it working. What I had misunderstood, was that I believed that a rewrite rule would change designers/?designer=some-designer&bid=9 to ...
1
vote
1answer
279 views
How to Rewrite Wordpress URL for a Plugin
I am trying to build a Wordpress plugin here with a custom user admin area. What I would like to do is when the user adds /edit at the end of the page, it should open a page from my plugin. So for ...
0
votes
1answer
2k views
Custom page with variables in url. Nice url with add_rewrite_rule
Using WP3.1
I Have a custom page with a WP_Query and the query gets dynamic variables from the url. And i want safe variables and clean urls.
Example:
...
12
votes
7answers
7k views
How do you create a “virtual” page in WordPress
I'm trying to create a custom API endpoint in WordPress, and I need to redirect requests to a virtual page in the root of WordPress to an actual page that ships with my plug-in. So basically, all ...
3
votes
3answers
1k views
Need help with friendly URL's in Wordpress
I'm creating som custom templates in Wordpress and I'm passing some data in the URL's.
Currently my URL looks like this:
http://www.mysite.com/designers/?id=43&name=designer+name
The URL ...
5
votes
1answer
345 views
Rewrite Rule for Multilingual Website, Like qTranslate?
I would like to write my own little plugin for language switching. For that, the very first thing would be to get the rewrite rules running. I have been looking around the web for 2 hours, but I ...
4
votes
2answers
1k views
Change the “page” slug in pagination
Simple question. When pagination is activated, the URL changes to "site.com/page/2". For my site, this should be "site.com/paggetto/2".
How can I change that rewrite rule? I also want to change ...
2
votes
1answer
3k views
Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT
Wondering if someone could tell me why sub pages (child pages) no longer work (eg: www.mysite.com/type/childpage).
I have a page called "Type" (working fine), and I wish to have Child Pages of "Type" ...
6
votes
1answer
4k views
How to create custom URL routes?
I have a very peculiar requirement, hopefully I can explain it without being too confusing. I created a page template where I list some properties I get from an external XML file, so far no problems, ...
3
votes
1answer
173 views
CPT Template Not Showing - Getting 404
I'm developing a Custom Post Type plugin, which works fine in dev. Now that I've moved it to production, I'm getting a 404 when I try to display the template for the CPT.
So, two questions:
1- Is ...
1
vote
1answer
804 views
Priority for Categories, Tags, Taxonomies, Posts, Pages and Custom Posts with same url
I have been reading dozens of posts and honestly, I have many doubts on how this work. Furthermore, I think that with WP3.1 more issues have been added here because I am having even more problems now ...
2
votes
2answers
1k 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 ...
3
votes
4answers
3k views
URL Rewrite + Page + Custom Post Type = Unusual Redirect
Yet another URL rewrite issue :)
The Problem
I have a URL rewrite rule that should work, but against all logic it redirects without passing the query var.
The Juicy Details
The site has a page ...
4
votes
1answer
336 views
Rewrite rule for Custom post type Monthly and Yearly archive
I have a custom post type "contest_recipe". I can view contest recipe posts by year and by date with the following urls:
http://example.com/2011/?post_type=contest_recipe - shows all 2011 contest ...
2
votes
1answer
715 views
Permalink rewrite with custom post type and custom taxonomy
I think thats a quick one:
I've got:
Custom post type: Food
Custom taxonomy (Registered to Food): Fruits
Terms in Fruits: Apple, Orange, Cherry
If I type in example.com/food?fruits=Apple,Cherry, ...
3
votes
2answers
299 views
How to use Post Custom Metadata in Post Titles and Post Permalinks
I am very new to WordPress. How can I use post custom metadata in place of Post Titles, and as the Post Permalink? For example, instead of domain.com/the-post-title, the permalink would be ...
3
votes
1answer
1k views
Querystring parameter getting lost in rewrite rule
I have successfully added a custom post type and the permalink structure works great. So, for instance, I've got a custom post type books, and the permalink to a book is /books/the-dictionary.
My ...
2
votes
3answers
299 views
flexible rewrite 'ramble' URLs with Wordpress
I want to access my post with id 17 like this:
http://localhost/archives/17/moot-bla-foo-ramble
In other words, the id shall decide, everything thereafter may (or may not) be the slug or anything ...
0
votes
1answer
315 views
Multiple parameters in a custom post type url rewrite
I have a custom post type called venues currently they display through the url format:
http://mywebsite.com/venue/{venue-name}
I would like to have the format:
...
9
votes
1answer
468 views
When should add_rewrite_tag() be used?
I've spent a few days trying to learn how to best add rewrite rules. So far my understanding is that a suitable way to add simple rules is to use add_rewrite_rules(), with large thanks to Jan Fabry on ...
3
votes
1answer
1k views
Add Rewrite Rule for custom page
Was trying to create author specific page with author specific URL and it was working fine,but when i created this URL did not taken in to account following 2 factors
Author Name Conflict (similar ...
1
vote
3answers
495 views
Custom Post Types: pretty search URLs and has_archive
This is a question based on the comments from the answer here.
I'm using the following code to create a couple of different search boxes for my website:
<form action="<?php echo home_url( ...
1
vote
3answers
437 views
How to add .htaccess code through a function?
I need to add the following .htaccess code through a function
<IfModule mod_deflate.c>
# Insert filters
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
...
2
votes
1answer
618 views
Using %postname% tag with a Custom Permastruct creates 400 Bad Request Errors from the server
This is related to another question that I had asked earlier. I'm doing some rewrite code to create some custom permalinks for a custom post type. I think I'm getting it mostly working except I'm ...
1
vote
2answers
1k views
Custom post types and custom variables — add_rewrite_tag() question
I'm stuck on this, and have no idea what I'm doing. I have a custom post type called areas, that is hierarchical. We want to pass a variable into the page, and have it be pretty. Currently, it is:
...
0
votes
1answer
91 views
Tricky URL rewrite with custom values in url
We have custom post type as user_images and each of these post has a image attached with image name is 3 digit number followed by extension.
When the url
http://mysite.com/wp_username/3digitnumber
...
0
votes
1answer
940 views
Custom post type permalink endpoint
I have a custom post type called "destinations" and I have set the EP mask for the post type to default EP_PERMALINK. I have added a couple of endpoints as follows :
add_filter( 'query_vars', ...
1
vote
1answer
243 views
Rewrite rule for a query string
I have a taxonomy search form and the link output is
http://localhost/wp/?cityid=16
But i want it to be rewrited as
http://localhost/wp/cityid/16
.htaccess
# BEGIN WordPress
<IfModule ...
1
vote
2answers
2k views
Removing taxonomy base using WP rewrite
I´m trying to create the following URL structure:
example.com/attractions <-- post type archive
example.com/attractions/taxonomy_term <-- taxonomy archive
...
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
1answer
328 views
custom rewrite rules causing unmatched parentheses at offset error [closed]
alright so i have these custom rewrite rules in functions.php that work fine:
function add_video_rewrite ()
{
add_rewrite_tag("%video_id%", '([^/]*)');
add_rewrite_tag("%video_slug%", ...
0
votes
1answer
271 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 ()
{
...
0
votes
1answer
298 views
Rewrite loading custom template file but is_home() returns true, and there's no 404
I want to create some custom pages for my theme that don't appear in the Page listing in wp-admin.
I have the following class which intercepts the url.
class jtvRewrite {
var $path = '';
function ...
0
votes
3answers
617 views
Need to make a php file inside theme accessible via url
I checked this post here Making a plugin file accessible via url rewrite? which seems to have the same problem as me but its for a plugin. But so far i am getting 404.
add_action( 'init', ...