Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fatal Error: Call to undefined function get_header() in OceanWP Theme #544

@alebedev80

Description

@alebedev80

Fatal Error: Call to undefined function get_header() in OceanWP Theme

Description

Encountering a PHP fatal error when accessing the website. The WordPress core function get_header() is not recognized, suggesting WordPress core is not properly loaded when the theme template is executed.

Error Details

[03-Sep-2025 03:14:29 UTC] PHP Fatal error: Uncaught Error: Call to undefined function get_header() in /var/www/virtual/htdocs/wp-content/themes/oceanwp/index.php:15
Stack trace:
#0 {main}
  thrown in /var/www/virtual/htdocs/wp-content/themes/oceanwp/index.php on line 15

Environment

  • WordPress Version: 6.8.2
  • PHP Version: 8.3
  • Theme: OceanWP
  • Server: /var/www/virtual/domain.com/htdocs/

Expected Behavior

Theme files should only be executed within the WordPress context where get_header() and other WordPress functions are available. Direct access to theme files should be prevented.

Actual Behavior

The index.php file appears to be executed directly (not through WordPress routing), causing WordPress core functions to be undefined and resulting in a fatal error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions