0

I created a custom template and called it Header Home"header-home.php"

<?php
/**
* Template Name: Header Home
*/
?>
<?php
  if( have_post() ) {
    while( have_post() ){
      the_post();
    }
  }
?>

Then on my front page i call it with

<?php get_header( 'home' ); ?>

Now, when i create a page, and use template "Header Home" and add my html content inside, it's not showing on the front page at all. Shouldn't the loop grab those html and add it on the header-home.php then be shown when get_header( 'home' ) is called?

When i add the html code directly in the header-home.php, it is working, but is there a way to add it within the dashboard page so it's easily "codeable"

2
  • I don’t understand what you’re trying to do. It doesn’t make any sense to create a header template and assign it to a page and also call it with get_header(). Have you read the documentation for these functions. What are you trying to do? Commented May 1, 2022 at 7:32
  • What i'm trying to do is create a theme that would be able to customize the header within the dashboard with html(actual coding) instead of coding it within the theme directory files. It's for more html/css type of person instead of using page builders and blocks. Commented May 1, 2022 at 9:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.