Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This is actually my first question here, so hello to everybody in this community!

I have developed a theme with a custom post type and a template (lets call it "my_template.php") that shows posts of this custom post type in an archive-like fashion.

What I'm trying to achieve is to make a permalink in the navigation of the site that goes to a specific template (like "my_template.php") and ignoring the wp template hierarchy.

How could one do that?

Note: I've already checked out This answer, but that one didn't really help and provided only a workaround.

Thanks!

share|improve this question
    
What do you mean by "ignoring the wp template hierarchy"? –  s_ha_dum Feb 22 '13 at 22:02
    
What I mean by that is usually if you are creating a custom post type, wordpress follows the template hierarchy e.g. it looks first for single-{custom-post-name}.php, then archive-{custom-post-name} etc and then at the end it falls back to index.php . What I wanted to achieve is avoiding that altogether and just give my custom post type a template to which I could refer to via a permalink. –  nairam Feb 23 '13 at 14:57

1 Answer 1

up vote 1 down vote accepted

You could see if a custom page template fits your needs. Create a Page with the desired permalink, then set its page template to "my_template.php", and you're good!

share|improve this answer
    
That worked perfectly! Great idea! Thanks! –  nairam Feb 23 '13 at 14:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.