WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom Post Type Theme Page Not Working (3 posts)

  1. Robert
    Member
    Posted 2 years ago #

    I have created a custom post type and called it 'videolibrary'. I then created a single-videolibrary.php page and put it in my custom theme root directory. When viewing the post, the single theme page is not working.

    I think copied the exact same file into the Twenty Eleven theme and it works fine with that theme activated, and also works fine when copied into a different custom theme.

    Any idea what could be preventing it from working in that particular theme?

    Thanks!

  2. Robert
    Member
    Posted 2 years ago #

    I found the problem! Here's what it was in case anyone else runs into this...

    My custom theme is using the Theme Hybrid core framework. I checked my functions.php and the problem jumped right out at me, I had enabled the hybird-core-template-hierachy:

    add_theme_support( 'hybrid-core-template-hierarchy' ); // Overwrites the default WordPress theme template hierarchy with a much more flexible and powerful templating system.

    Commenting this out has fixed the issue.

  3. wpfan1000
    Member
    Posted 2 years ago #

    Hi,

    Maybe this will help you:

    In the Hybrid theme is a file called singular.php

    Inside this file it says:

    The template hierarchy for singular views
    * of post types is like so: $post_type-$template.php, $post_type-$slug.php, $post_type-$id.php,
    * $post_type.php, and singular.php.

    Maybe try naming your file one of these.

    I think this may be a better approach than changing the code of the theme, since that may get overwritten on a theme update.

Topic Closed

This topic has been closed to new replies.

About this Topic