Plugins were not working for my custom page template, found out that I needed to put WP_head() and WP_footer(), so did that and the plugins started to work. But now the background changed to that of the default template.

If I remove wp_head(), the custom template's background comes back, but plugins do not work anymore. If I use get_header(), logos, menus,background, etc. floods the custom page template, which I don't want.

Please help.


Custom page template code:

Template Name: OldSkool

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 <title>Salesletter Template</title>
 <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/OldSkool-src/style.css">
<style type="text/css">
.style1 {
    font-size: 24px;
    color: #000000;
.style2 {color: #FF0000}
.style3 {
    font-size: 14px;
    color: #333333;
.style4 {color: #990000}
.style4 {   font-size: 18px;
    font-weight: bold;
.style9 {font-size: 16px}
.style7 {font-weight: bold; color: #990000; font-size: 18px;}
.style10 {color: #999999}

function mypage_head() {
    echo '<link rel="stylesheet" type="text/css" href="'.get_bloginfo('template_directory').'/OldSkool-src/style.css">'."\n";
add_action('wp_head', 'mypage_head');
<?php wp_head(); ?>

<div id="wrapper">
  <div id="header">

   <div id="content">
     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

        <?php the_content('Read the rest of this entry &raquo;'); ?>    

    <?php endwhile; else: ?>

        <p>Sorry, no posts matched your criteria.</p>

        <?php endif; ?>
  <div id="footer">
      <strong><?php wp_footer(); ?><a href="http://www.planstoprosperity.com" style="color:#FFFFFF" target="_blank"><font color="#FFFFFF"></a></font></strong>
  • Please provide code examples, as well as how you are defining your background, there is much you're assuming that we are unaware of and cannot see ( we're not psychic! )
    – Tom J Nowell
    Aug 20, 2012 at 14:21
  • 1
    Downvote for lack of code, rendering this question impossible to answer. Will remove if question is edited to include relevant code. Aug 20, 2012 at 15:41
  • Thanks for the edit. Downvote removed. See answer below! Aug 20, 2012 at 17:59

1 Answer 1


As I suspected, the issue is where/how you're outputting your custom stylesheet.

First, move this to functions.php:

function mypage_head() {
    echo '<link rel="stylesheet" type="text/css" href="'.get_bloginfo('template_directory').'/OldSkool-src/style.css">'."\n";
add_action('wp_head', 'mypage_head');

Second, change the action into which you're hooking your callback.

You're using wp_head. All other stylesheets will be using wp_print_styles. The wp_print_styles action fires inside of the wp_head action, and will fire after your callback that is hooked directly into wp_head.

So change this:

add_action('wp_head', 'mypage_head');

...to this (note the decreased priority, which will cause it to output later than everything firing at the default priority of 10):

add_action( 'wp_print_styles', 'mypage_head', 11 );

Note: if this still doesn't work, then we'll need to know what hook the Plugin is using to output its sytlesheet, as at that point, the problem will be that the Plugin is using a priority greater than 10, or is using a different action hook.

  • Please refer to my Before/After images of the Custom Page Template (OldSkool) and the Default Template (Mainstream). The Before images are when I have not added anything to either the OldSkool.php or functions.php. After images are when I added the codes as per your guidance. Before images - linklink After images - link link
    – Seal
    Aug 21, 2012 at 4:52
  • What is the desired outcome? And can we get a live link of the rendered output? Aug 21, 2012 at 5:39
  • Here are the links: link link I want the "CLICK LIKE & GET YOUR FREE FINANCIAL PLAN" to be centered in the page within a colored button, which I have set in the settings of the plugin wp-like-locker. When someone clicks the facebook Like button below, a hidden content is shown. Both of these are not working at present. And as you can see the webpage is not rendered correctly.
    – Seal
    Aug 21, 2012 at 6:52
  • Where are those styles defined? Inline stylesheet, or linked stylesheet? If linked: which stylesheet link? Aug 21, 2012 at 14:24
  • Styles are defined at wp-content/themes/mainstream/OldSkool-src/style.css
    – Seal
    Aug 21, 2012 at 14:40

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.