ekino / EkinoWordpressBundle

Integrate Symfony with WordPress and WordPress with Symfony
GNU General Public License v2.0
312 stars 79 forks source link

Fatal error: Call to undefined function get_header() #128

Closed bornbygoogle closed 7 years ago

bornbygoogle commented 7 years ago

Hi, I did as Readme Guide.

Scheme of root : app / bin / src / vendor / web / wordpress

With the content of index.html.twig :

{{ wp_get_header() }} {{ wp_get_sidebar() }}

Your Twig code comes here

{{ wp_get_footer() }}

But, I got this error : Fatal error: Call to undefined function get_header() ( 500 : internal error ).

Can you tell me how to fix the error, please ? Thanks.

eko commented 7 years ago

Hi @bornbygoogle,

At this time, it seems that your WordPress is not loaded so your Symfony application can't find the get_header() function.

As specified in the README file: https://github.com/ekino/EkinoWordpressBundle#installation

The symfony and wordpress directories have to be (by default) organized as follows:

project
|-- wordpress (web root)
|-- symfony (not available over HTTP)

(See: https://github.com/ekino/EkinoWordpressBundle/blob/60d4ea4f691c01724b9ccc25afeb7cff8bf2cea2/DependencyInjection/EkinoWordpressExtension.php#L56)

Can you please reopen this issue if there is another issue?

Thank you