2
votes
1answer
104 views

How to stop wordpress to make the default query?

My goal is a redirect to a custom template based on some new rewrite rule, but without having wordpress to make unusefull queries. my code: function add_rewrite_rules() { add_rewrite_rule( ...
0
votes
1answer
18 views

Taxonomy Parent not showing up in address bar

I created a custom taxonomy successfully and assigned the custom post type as well. It is a hierarchical taxonomy and I added terms in the back in a hierarchical way. I added for instance main ...
1
vote
2answers
147 views

Filter to change the content of 404 page

I have created custom rewrite rules. These rules now go to 404 page as expected. I can use action hook template_redirect to change the template matching query_var. But I don't want to create separate ...
0
votes
2answers
176 views

Rewrite rule shows 404 page

I am new to Wordpress so I don't really know how the rewrite rules should look like. My problem is that I have a custom template in my theme called portfolio-inner.php My rule looks something like ...
0
votes
0answers
25 views

Stuck with custom URL REWRITE

Hello I'm creating a custom url rewrite structure for my WordPress site. First I had the following code to have url: /objekt/<GID> which loads objekt page and have query var GID. add_action( ...
0
votes
1answer
376 views

Dynamically generated URL and Content page

I am in need of some advice. I have a section on my home page dynamically pulling in a list of terms from a custom table in the WP db. I have made a unique custom URL for each of these terms based on ...
0
votes
0answers
110 views

Select good template with rewriting rules

After creating the sub page "China" of the parent page "Destinations", I add to it the "Destinations countries" template. Without any redirection, I can display the correct template at this url : ...
4
votes
1answer
116 views

Using a page template without a page

Does anyone know if it's possible to use a page template on a URL, even if a page doesn't exist for that page? When building sites, I create the relevant pages to ensure use of the templates, but ...
2
votes
1answer
2k views

Passing parameters to a custom page template using clean urls

I am now passing parameters to a custom template in the following format www.example.com/?pageid=12&rid=24&title=this-is-the-title I have created two tables . So I need to fetch data and ...
1
vote
4answers
3k views

Wordpress not respecting template hierarchy (fetches index.php instead of single.php or page.php)

I've encountered a strange error while developing a custom theme. After finishing editing the template for a custom post type single view, I passed onto working at the template files for pages and I ...
0
votes
2answers
936 views

add_rewrite_rule and template redirect not working

I have the following pairs: add_rewrite_rule('^questions/ask/?','index.php?pagename=ask','top'); if(is_page('ask')){ $tname = 'add-question.php'; ...
11
votes
1answer
11k 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
3k views

How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy

This answer provides the code for a query that returns an OR match on a taxonomy term: global $query_string; $args['tax_query'] = array( array( 'taxonomy' => 'status' ,'terms' ...
2
votes
2answers
677 views

Create built-in pages without creating actual pages

For example: site.com/contact (or site.com/?page=contact if not using permalinks) when someone goes to that page I want to load a theme template, like page-contact.php But I don't want to create a ...
2
votes
2answers
862 views

Preventing index.php?category_name=something from redirecting

I'm trying to filter posts in a category by the year of the post's date. I also want to do this without being redirected to the year template so my ideal URL would be ...