Child theme in version 5

Hi!

We have a child theme with a separate page/php-file that only can be managed on ftp. In that php-file we want the header and footer to appear so it looks like all the other pages. This worked until we updated to version 5. Do you know if there is any new changes in version 5?

The header file location is x-child/framework/views/global/_header.php

Thanks!

Hi There,

Thanks for writing in! With the new release of X v5.x, those files have been moved into the following path.

x/framework/legacy/cranium/headers/views/global/

Hope that helps.

Hi,

Thank you for your reply, found what I think is the correct place now.

I thou still got my problem and I have now found that get_header() is the bad guy.
This is how my php-file looks like:

<?php 
require realpath(dirname(__FILE__).'/init.php');
require realpath(dirname(__FILE__).'/backend.php');
require realpath(dirname(__FILE__).'/shared.php');

get_header();

?>

<div class="store-outer mf-login">
  <div class="store-container">
    <div class="store-content">
      <div class="store-header">Login</div>
      <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
        <div class="store-content-flex">
          <div class="store-item">
            <p>Användarnamn:</p>
            <input type="text" name="username" id="username" placeholder="_______________________" value="<?php echo $username;?>">
          </div>
          <div class="store-item">
            <p>Lösenord:</p>
            <input type="password" name="password" id="password" placeholder="_______________________">
          </div>
        </div>
        <span class="validation-error"><?php echo $error;?></span>    
		<div class="store-footer">
			<div class="store-button"><input type="submit" value="Logga in" /></div>
		</div>
	  </form>
    </div>
  </div>
</div>
</div>

<?php get_footer();?>

My problem is that get_header() and get_footer() doesn’t return anything, they are blank. In version 4 this worked great but after upgrading to 5 there is no header or footer code in the output html.

No error message what so ever.

Any clue what this can be?

Thanks

Hi There,

Make sure that your template file is added correctly on your child theme folder. That function should certainly work unless your custom template is on your plugin and not X theme child theme folder. See this: https://theme.co/apex/forum/t/how-to-call-x-header-and-footer-from-code/6097/4