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 childtheme: Fisio

Inside I have: page-team.php with the name:

<?php
/*
Template Name: Page - Team
*/
?>
<?php get_header(); ?>
<script>alert('its the team page')</script> 

And in the wp-admin I selected it for the page: Team

Please check the page name and the selected template

The problem is that any changes I make to page-team.php are not affected. In fact, the alert is never executed.

What am I missing?

PD: Is there a way to know wich was the template used having a look to the source code? I can't find this

-EDIT-

forgot to mention that team is listing a custom post_type: team, here is the declaration in functions.php

<?php
/**
 * Custom Post type register framework
 */
include(get_stylesheet_directory(). '/inc/acpt/init.php');
add_action('init', 'makethem');
function makethem() {
    $args = array(
        'supports' => array( 'title', 'editor', 'page-attributes', 'thumbnail', 'excerpt'  ),
        'hierarchical' => true,
    );

    $team = new post_type('team','team', false,  $args );

}

/**
 * Initialize the metabox class
 */
add_action( 'init', 'be_initialize_team_meta_boxes', 9999 );
function be_initialize_team_meta_boxes() {
    if ( !class_exists( 'team_Meta_Box' ) ) {
        require_once( get_stylesheet_directory(). '/inc/metaboxes/fisio-metaboxes.php' );
        require_once( get_stylesheet_directory(). '/inc/metaboxes/init.php' );

    }
}
?>
share|improve this question
    
have you save changes after you selected new template for a page? –  Eugene Manuilov Mar 6 '13 at 12:08
    
Yes I Did. It did not return any error or warning and the template its still selected in the page settings. Any thoughts? –  Toni Michel Caubet Mar 6 '13 at 12:11
    
I checked your code and its working fine. can you just show me which classes are gets added to body tag in front end? –  Vinod Dalvi Mar 6 '13 at 12:14
    
Hello @VinodDalvi Thanks for your comment but I'm not sure i'm following you. If you mean the class attr to the body is: "archive post-type-archive post-type-archive-team logged-in admin-bar customize-support" –  Toni Michel Caubet Mar 6 '13 at 12:19
    
Yes I have, I will add the declaration to the question. Thats right its in maintenance mode i don't think i'm allowed to share it.. –  Toni Michel Caubet Mar 6 '13 at 12:29
add comment

1 Answer 1

up vote 3 down vote accepted

You have created custom post type named team so it is displaying archive of custom post type team on the team page try changing slug of team page from team to team2 or something else but not team.

Visit this page to learn more about how wordpress handles templates.

share|improve this answer
    
Yay! That was it! Thanks a lot! –  Toni Michel Caubet Mar 6 '13 at 12:35
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.