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 have a page called portfolio and I have created several child pages for it like Video page, audio page etc …

I also created custom page template for portfolio and named its file portfolio-template-ahsan.php. But when I use it on my child page as a custom template, it gives me the 404 error page.

Now what I am confused about is how this naming convention works, and how should I name the child custom page templates, if I remove the Parent page from Video page, then the template works fine, but when I use Portfolio page as parent page, it gives me 404 error

here is the code for the inner page template, could it be a problem if the parent page have different template and child page have different page template

<?php 
    /* 
Template Name: Portfolio template column four simran
*/
?>
<?php
get_header('ajax'); 
include('portfolio_loop.php');
get_footer(); 
?>
share|improve this question
1  
So far everything you described should be working just fine. Any more details you can think of and provide? Maybe code of your template (leave unimportant parts out if there is a lot of it) ? –  Rarst Oct 26 '12 at 22:19
    
Can you add the (basic) code for that loop? It might be where your problem is. –  guiniveretoo Oct 28 '12 at 5:59
    
Added the code for the portfolio_loop.php file, it was a theme i purchased from themeforest so i dont know much about its coding stuff –  Muhammad Ahsan Oct 29 '12 at 7:19
add comment

1 Answer

If you're working with custom post types and keep getting 404 errors, you often just need to re-save your site's permalinks under Settings > Permalinks. Try that and let me know if it works.

share|improve this answer
    
No i tried setting permalinks many times, but strangely these page templates are working fine on my WAMP server installation –  Muhammad Ahsan Oct 29 '12 at 7:20
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.