Parsing variables from URLs into custom PHP / Getting Header/Footer to show up

Hey there,
So I have a website that has a lot of sections off the root directory (i.e outside the ‘wp-content’ folder) that use custom .htaccess and PHP to pull from a database. The old Wordpress theme was a Child Theme based on TwentyTwelve so it was easy to get the header and footer with get_header() and get_footer().

Now I’m trying to modernize the site, but I’m having a problem whereby the get_header() and get_footer() won’t snag the lovely Header and Footer I created with the Header and Footer builder.

Since the site is dependent on having these .htaccess Rewrite PHP database calls (at least for now) I would love to know if there’s a way to get the header and footer to show up in the PHP pages I’m using.

I know that seems a little vague but I’d be grateful for any discussion on how this can be achieved.

thank you!
Dan

Hello @dgoldwas,

Thanks for writing to us.

In case if you have created a custom Header/Footer from Pro Header/Footer builder you can call the Header/ Footer by assigning the Header/Footer condition. Please have a look at our doc https://theme.co/docs/header-footer-overview#assigning-your-first-header-footer

You don’t need extra coding to call custom Header/Footer that has is been created through Pro Header/Footer builder.

Hope it helps
Thanks

Thanks Prakash

Unfortunately that doesn’t help since the PHP files are outside the Wordpress system. (The PHP files are located in /video/, for example, in the file system structure, outside of wp_content)

For the older WP theme they pulled in the Wordpress environment with

<?php
define('WP_USE_THEMES', false);
require($_SERVER['DOCUMENT_ROOT'].'/wp-load.php');
/// pre-header code went here
get_header();
?>

And it worked very nicely and allowed for all the variables from the .htaccess rewrite to be pushed through:

RewriteEngine On

RewriteBase /video/
RewriteRule ^([A-Za-z0-9-]+)/?$ detail.php?id=$1 [L]
RewriteRule ^([A-Za-z0-9-]+)/index.php?$ detail.php?id=$1 [L]

So I know that right now get_header() doesn’t pull the Themeco Header I designed, but I’m hoping there is some way to get that to work? OR is there a way to set it up so that there’s a Wordpress page called “Videos” (with /video/ as the slug) that will let me pass variables such as /video/123/ even though such a WP page doesn’t exist?

thanks!
Dan

Hello Dan,

Sorry for the confusion. The feature that you want would require custom development. I would suggest you contact a developer who can assist you with your concern. Please note that we don’t provide custom development support. It is out of the support scope.

You may have a look at the action and filter hook documentation it might help you.

To use custom code you need to have a child theme for that you can download the child theme from here.

Thanks for understanding

That’s too bad. Hopefully you can add something where we can pull the Themeco headers and footers into custom PHP in the future.

Noted. If there is anything else we can help you with, please do not hesitate to open another thread.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.