X Theme, I need the php to render full header and footer

I have a php file inside a plugin directory, /wp-content/plugins/myplugin/index.php. It has get_header() and get_footer(). The problem is it only gets part of the header and footer. The header and footer is missing their main content i.e. … and all its nav content/html nav-menu, nav-items etc. and the entire content/html for the footer. I need the references and code to display the full header and footer on a page made programmatically, please see below.

current

<?php get_header(); //mycode get_footer(); what I need <?php get the full X theme header with nav, like all other pages //mycode get the full X theme footer with nav, calendar, search etc. like all other pages Please help this is driving me crazy.

Hey George,

Thanks for writing in! Regretfully, this particular customization request is outside the scope of our support as this is not related to an issue with the theme and instead has to do with your customization of it. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself.

Thank you for your understanding.

I’m sorry, it seems you don’t fully understand the question. The issue with your theme is that it does not comply with the wordpress standard.

Please see https://developer.wordpress.org/reference/functions/get_header/.
“get_header( string $name = null ): Load header template. Includes the header template for a theme or if a name is specified then a specialized header will be included.”

I find hard to believe this issue hasn’t come up/been answered before or the solution is for me to rewrite your non-compliant theme. Please escalate this support post to a developer to answer the question: How is the best way to write static php page that renders your themes full headers and footers without using the standard wordpress method of get_header and get_footer.
Thanks

Hi George,

It does comply to Wordpress standard, but you probably expect to see it in a particular location especially it’s been like that on other themes.

Please check this reference for customization
https://theme.co/apex/forum/t/customizations-best-practices/205,
https://theme.co/apex/forum/t/how-to-upload-xtheme-to-child-theme/43246/2,

Our theme uses x_get_view which is the same as Wordpress standard get_template_part and there is no rule to where should the template parts be placed. In our theme, they are placed within /framework/views/. With theme with many features, we divided it to multiple parts just like other rich-featured themes for easy management and customization. For standard or minimal theme like with less feature, you may only see them coded in single template including the get_header() and get_footer(), but it doesn’t mean it should be the same on all themes.

In our theme, get_header() and get_footer() are located in each stack folder, /framework/views/{STACK}/. This is because in our theme, there are multiple stacks that act like a sub-theme/template to give more options for users and it’s something not available on a standard theme. And it can’t be done or at least not recommended on a single page template. An example, let’s say the active STACK is integrity (Theme Options > Stack)

/framework/views/integrity/wp-page.php

<?php

// =============================================================================
// VIEWS/INTEGRITY/WP-PAGE.PHP
// -----------------------------------------------------------------------------
// Single page output for Integrity.
// =============================================================================

get_header();

?>

  <div class="x-container max width offset">
    <div class="<?php x_main_content_class(); ?>" role="main">

      <?php while ( have_posts() ) : the_post(); ?>
        <?php x_get_view( 'integrity', 'content', 'page' ); ?>
        <?php x_get_view( 'global', '_comments-template' ); ?>
      <?php endwhile; ?>

    </div>

    <?php get_sidebar(); ?>

  </div>

<?php get_footer(); ?>

Still, we can’t provide custom development here in the forum and those functions aren’t missing.

Thanks!

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