WordPress.org

Support

Support » Themes and Templates » [Resolved] Custom Post Type Theme Page Not Working

[Resolved] Custom Post Type Theme Page Not Working

  • 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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Custom Post Type Theme Page Not Working’ is closed to new replies.
Skip to toolbar