Programmatically include header code | WordPress.org

[ad_1]

Hi @lagzer,

Yes, you can do that using the function wpcode_global_frontend_header() for the header code and wpcode_global_frontend_footer() for the footer.

Please add function_exists checks in the code if you plan on adding these to your template files directly.

Instead of that, I recommend creating a new PHP snippet in WPCode, set it to Shortcode mode and in the code area simply add wpcode_global_frontend_header() (do the same for footer with another snippet) and then use the WPCode Shortcode to insert the snippet where needed if that’s an option. This way, if you ever deactivate the plugin for some reason you will not run into a fatal error.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer