$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>php - wp_head makes my custom page template not work in Customizer?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

php - wp_head makes my custom page template not work in Customizer?

matteradmin8PV0评论

I have a weird issue where if I am in the Customizer and visit a page which uses a custom page template I made it doesn't load the site in the preview. But I can see that it loads in the console. I found out that the <?php wp_head(); ?> was the issue. If I remove this part in the site template PHP file it loads just fine. But of course it doesn't look or work right.

I use <?php wp_head(); ?> and <?php wp_footer(); ?> because the rest of the theme uses a different header and footer, so I don't want to call get_footer and get_header (also this doesn't solve the problem I am having).

Any ideas why this is happening?

I have a weird issue where if I am in the Customizer and visit a page which uses a custom page template I made it doesn't load the site in the preview. But I can see that it loads in the console. I found out that the <?php wp_head(); ?> was the issue. If I remove this part in the site template PHP file it loads just fine. But of course it doesn't look or work right.

I use <?php wp_head(); ?> and <?php wp_footer(); ?> because the rest of the theme uses a different header and footer, so I don't want to call get_footer and get_header (also this doesn't solve the problem I am having).

Any ideas why this is happening?

Share Improve this question asked Nov 24, 2018 at 12:14 joq3joq3 3813 silver badges21 bronze badges 4
  • Do you have anything custom hooked into wp_head on that template? – Jacob Peattie Commented Nov 24, 2018 at 12:34
  • Nothing, just searched through my complete theme folder. – joq3 Commented Nov 24, 2018 at 12:37
  • Scripts are enqueued on wp_head remember. – Jacob Peattie Commented Nov 24, 2018 at 12:47
  • Tried removing all the enqueue scripts from the theme, no change. – joq3 Commented Nov 24, 2018 at 12:54
Add a comment  | 

1 Answer 1

Reset to default -1

you can try this way:

<?php get_header('your_custom_header');?>
<?php get_footer('your_custom_footer');?>
Post a comment

comment list (0)

  1. No comments so far