WordPress.org

Ready to get started?Download WordPress

Forums

Single Custom Post Type & Call to undefined function get_header() (1 post)

  1. christian_korak
    Member
    Posted 2 years ago #

    I'm encountering a really strange problem:

    If I call a single custom post type, I get a "Call to undefined function get_header()" in a custom page template, which shouldn't be rendered at all for this single post ...

    In detail:

    • A custom post type named "portfolio" with 'rewrite' => true.
    • A custom page template portfolio.php, which has a loop for all 'portfolio'-posts and is the front page.
    • A single-portfolio.php to display the portfolio post type.

    In my local environment (which uses beside the db-settings in wp-config.php the identical files like the server where the problem occurs) the permalinks for single portfolio posts are working.

    On the server the whole website is working as supposed to. Except: If I'm calling a single portfolio post, i get a Call to undefined function get_header() in portfolio.php, the custom page template, which shouldn't be rendered at all for showing this single post ...

    I don't actually have a clue, where I should start looking. Especially as it's working on the local environment.

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by christian_korak
  • This topic is not resolved
  • WordPress version: 3.2.1

Tags

No tags yet.