The template-redirect tag has no wiki summary.
11
votes
4answers
3k views
single-{$post_type}-{slug}.php for custom post types
My favorite part of the Wordpress template hierarchy is the ability to quickly create template files for pages by slug, without having to edit the page in Wordpress to select a template.
We can ...
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, ...
5
votes
1answer
2k views
Custom Post Types and template_redirect
I have two custom post types (e.g. post_type_1 and post_type_2) that I would like to redirect to independent templates (single-post_type_1.php and single-post_type_2.php) to handle their display. I ...
4
votes
3answers
388 views
Wordpress multisite,several different languages,page redirect?
I have something like this http://example.com/en , http://example.com/fr and http://example.com/es for example I would like if I'm on this page http://example.com/en/about-us/ when I click on other ...
3
votes
1answer
243 views
Want to redirect if search query match exact title of any post
I am using WordPress 3.3.1 and new to this system. I want to redirect the search query to the post if query exactly matches post title of some post.
I also want it to run before any search query ...
1
vote
4answers
583 views
Where does the 404 redirection happen?
Can someone please tell me where the 404 redirection occurs?
I am wanting to redirect to a custom template.php instead of the 404 page.
Is this possible to do? If it is can some one provide me with ...
1
vote
2answers
274 views
Are Category or Tag Archive Pages Possible?
Currently /category and /tag 404 if you hit them directly. Is it possible to create a theme template to handle what would display on it? Mark Jaquith - ...
1
vote
1answer
1k views
template_include (overriding default plugin templates via current theme)
This is an extension of this question/answer. A comment on that question references that template_include is preferred to template_redirect when loading templates from a plug-in.
However, hanging ...
1
vote
2answers
253 views
wp_head() not including styles and javascripts after a template redirect
I am using the template_redirect action to redirect a user to a custom template which has no header, sidebar or footer (the intent is for it to be in an iframe as a dialog box). After I done the ...
1
vote
2answers
220 views
Common single page template options
I am developing a common theme for 25 websites, the default requirements are done. Each site has got different single post template. I need to group it as a single theme so i don't need to hard-code ...
1
vote
1answer
230 views
Different Template based on HTTP Referer
He Guys,
i've been looking for a way to show a different Page-Template based on HTTP Referer or maybe the User Agent or what ever.
I'm planning an Image-Gallery which should be shown in a Fancybox. ...
0
votes
1answer
589 views
Change template dynamically
Is it possible to change the template loaded for a page, as it loads, without having to change the record in the database?
I suspect it can be done with the template_redirect action, and the will ...
0
votes
2answers
46 views
How should I approach changing the template & $query as part of a shortcode's execution?
I am working on a project where I need to be able to change the template being used if a given shortcode is used. To complicate things more, the plugin must also be able to rewrite $query if this same ...
0
votes
1answer
53 views
Custom template redirect based on url vars
I am using a custom URL on my menu to show the most viewed posts by passing the variables to the url as
http://website.com/?v_sortby=views&v_orderby=desc
However I want to use a custom template ...
0
votes
2answers
310 views
template_redirect is firing any part that a single post is present [closed]
I have a function (as part of a class) that checks for a custom field and, if present, does a wp_redirect. That part works, but it fires on both the individual post AND any other page that has that ...
0
votes
1answer
144 views
What hooks, actions or filters i can use to customize wordpress registration page and form?
i would like to customize the design of the registration page of wordpress and also the registration form. Can i create a registration page template? or maybe tell wordpress to use a custom ...
-1
votes
3answers
212 views
Proper method to restrict non logged users into certain pages
I was wondering which is the correct method to do this and which action hook should i use.
I have custom login/register pages so if the user try to go to a forbidden page and its not logged in i ...
-1
votes
1answer
123 views
Default taxonomy template in plugin, override in theme
Building off of this question/answer, I've sucessfully implemented the single view for my custom post types, but I'd also like to offer the same thing for taxonomies. I've looked through the docs and ...