I really want to use X-Theme for the Wordpress portion of my website and have the headers and footers integrate with the non Wordpress portion of the website to get the overall same look and feel. However, I cannot get the standard Wordpress method to work with the X-Theme. It works with themes from Brainstorm Force, BNE Creative, AVADA and several others. Using the standard method below will not render the header. I’m using an X-child theme and have tried it without the child theme to no avail. Any help would be appreciated.
<?php require('/the/path/to/your/wp-blog-header.php'); get_header(); ?>Hi @DonnyAnderson44,
I am not certain what you are trying to do. Do you want call the header file of X Theme and include it in another file?
The template system of X is divided into the stacks that is set on the site. If you open the index.php file, you will see the line of code: x_get_view( x_get_stack(), 'wp', 'index' );. The file that function is calling is the wp-index.php that is in framework/views then directory name that is the stack you are using for the site.
Please provide us more information on what you are trying to do so that we can provide a better suggestions.
Thank you.
Yes, I want to have the header and footer display with the content from the other part of the website in between the two. The standard way that the Wordpress codex indicates this to be done is by the code in my initial post. See the Wordpress codex at this link: https://codex.wordpress.org/Integrating_Wordpress_with_Your_Website . I am trying to determine what of that code needs to change in order to get X to display the Ethos stack header and footer.
Hi @DonnyAnderson44,
Regretfully I would not expect this to be possible with X, at least not out of the box. There’s likely a way to do it with custom development and a child theme, but this would be outside the scope of support we can offer. X assumes you’re working in a standard WordPress environment. The article mentions two code snippets:
Snippet 1
<?php
/* Short and sweet */
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
?>
Snippet 2
<?php
require('/the/path/to/your/wp-blog-header.php');
get_header();
?>
If you use Snippet 1, WordPress will not load a theme at all. Your existing PHP code will be responsible for providing the entire site layout (header, footer, etc.) but you will have access to WordPress functions. This means you can query the database and display posts using your own design.
If you use Snippet 2, the theme will load, but that makes the theme responsible for outputting the main tags like html and body. Themes are meant to have control over the front end markup. The benefit here is that you can pull existing code from your site to be rendered inside the theme’s header and footer, but you can’t wrap the theme in another design.
Maybe I’m missing something, but I don’t see how this could work with other themes unless you’re somehow duplicating the <html> tags.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.