The tag has no wiki summary.

learn more… | top users | synonyms

12
votes
5answers
5k 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 ...
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, ...
1
vote
1answer
3k 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 ...
6
votes
1answer
4k 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 ...
1
vote
1answer
69 views

Include a file before current template file

I would like to include two files before and after current template. I am using template_redirect to do this, But when I call get_current_template() inside template_redirect it returns nothing. is ...
1
vote
4answers
706 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 ...