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.

I created a custom post type and I would like to list the posts. I choosed page template with custom query instead of the archive-xy.php to list the posts because the user would like to edit the content on the page. The custom query is works, but If I create a page with slug XY and I open the page the template not works, I see the the default layout (index.php). I renamed it for example to xy-2 and it works.

Is it possible to disable the domain.com/xy, because It's using the blog layout? (because no archive-xy.php).

share|improve this question
    
do you need more info, or is it clear? –  Rinoleti Feb 27 '13 at 13:14
    
No, it is not at all clear. –  s_ha_dum Feb 27 '13 at 14:04
    
So, I created a custom post type with the "career" slug. After that I created a page template with my custom layout for this post type, and with a custom query. Everything works, the template list my posts. But.. If I type domain.com/career to the browser I see the posts but the layout is different, because It's using the index.php file for layout. I know I can create archive-career.php with my custom layout, but It's not perfect for me because I can't edit the content. So I don't want my visitors, to see domain.com/career only domain.com/career-page what is a page, with a page template –  Rinoleti Feb 27 '13 at 14:18
add comment

1 Answer

'has_archive' => false and everything works.

share|improve this answer
2  
Please explain why that could solve the problem. –  toscho Feb 28 '13 at 14:04
    
because I can create a page with career slug, if this value is true everytime when I opened domain.com/career I saw the layout for the normal blog posts, it used the index.php template. –  Rinoleti Feb 28 '13 at 16:08
    
Please improve your answer, don’t hide important information in comments. :) The next reader with the same problem should get a guide, easy to understand, nicely explained. –  toscho Feb 28 '13 at 16:14
    
btw I don't know why if I rename the page's slug to career2, and i open domain/career2 it redirects me to /career –  Rinoleti Feb 28 '13 at 16:14
add comment

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.