• Resolved daktau

    (@daktau)


    Hi,
    I have read many posts about this but nothing is working for me. I need to have a page’s theme available to me in the page attributes section but nothing is showing up.

    I have this as the start of my page….

    <?php
    /*
    Theme Name: Right Hand Column
    Description: Includes a right hand column
    */
    ?>
    
    <?php
    get_header();
    $id = url_to_postid($_SERVER["REQUEST_URI"]);
    $page_data = get_post( $id );
    ?>

    The file resides in /wp_content/themes/cusom_theme/rightHandColumn.php
    There are no active plugins.
    I have tried swopping between themes so to re-activate the theme.

    Is there anything obvious that I’m doing wrong here? Does the name of the file need to match the theme name at all?

    Thank You,
    George

Viewing 15 replies - 1 through 15 (of 15 total)
  • Try removing Description: Includes a right hand column.

    Thread Starter daktau

    (@daktau)

    I’ve done this but no joy.

    Still no options under page attributes.

    Is the name of the file ‘rightHandColumn.php’ at all important or does wordpress scan all files in a theme folder for ‘Theme Name:’ regardless?

    What theme are you using? Where did you download it from?

    Thread Starter daktau

    (@daktau)

    This is a custom theme that I have created using twentythirteen as a base then altering header.php, page.php and footer.php

    Does the custom page template work in the original 2013 theme?

    Thread Starter daktau

    (@daktau)

    No it seems not. I copied the file into the twentythirteen folder, swopped to that theme and still nothing shows up in the page attributes in the page edit screen.

    Then there appears to be an issue in your template code. what happens if you just yse:

    <?php
    /*
    Theme Name: Test
    */
    ?>
    
    <?php
    get_header();
    echo "Boo!";
    get_footer();
    ?>
    Thread Starter daktau

    (@daktau)

    Still nothing!

    I have this code

    <?php
    /*
    Theme Name: Test
    */
    ?>
    
    <?php
    get_header();
    echo "Boo!";
    get_footer();
    ?>

    in a file called test.php within wp-content/themes/custom_theme/ and still there is no option to choose this in the page attributes.

    No – add that test template to the 2013 theme.

    Thread Starter daktau

    (@daktau)

    yeah, just done that and still nothing. πŸ™

    What did you call the template file?

    Thread Starter daktau

    (@daktau)

    test.php

    Change Theme Name: Test to Template Name: Test.

    Thread Starter daktau

    (@daktau)

    Ha Ha (groan),
    That was it. Seems so obvious now.

    Thanks a lot, very helpful of you!!!

    No problem. Just sorry I didn’t spot that earlier. πŸ™‚

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Missing template attribute in WordPress 3.7.1’ is closed to new replies.