Solved

WordPress header.php and footer.php errors

Posted on 2013-05-30
5
1,038 Views
Last Modified: 2013-06-14
Your theme needs to be fixed for plugins to work (Especially Floating Social Media Icon). To fix your theme, use the Theme Editor to insert <?php wp_head(); ?> just before the </head> line of your theme's header.php file.

Your theme needs to be fixed for plugins to work (Especially Floating Social Media Icon). To fix your theme, use the Theme Editor to insert <?php wp_footer(); ?> just before the </body> line of your theme's footer.php file.


I get the two above warnings at the top of a page in Skematik theme with WP 3.5.1. The theme only  has one line of do_action code in the header.php and footer.php files in theme editor. There is also a skematik-header-functions.php and similar footer file. I modified them with the php code but still get the same issue.

What else should I try?

Mark
0
Comment
Question by:MarkJulie
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:Ishaan Rawat
Comment Utility
Do as the code says..

Add <?php wp_head(); ?> in the header.php just before closing the head tag..
and
add <?php wp_footer(); ?> in the footer.php just before closing the body tag....

Don't know why to put them...
See the official documentation...

http://codex.wordpress.org/Function_Reference/wp_head
http://codex.wordpress.org/Function_Reference/wp_footer
0
 

Author Comment

by:MarkJulie
Comment Utility
screenshot header.php
Please be so kind as to explain which line of code represents the closing head tag in this screenshot. My suspicion is that there may be another file to edit. I am new to WP. The code in the footer.php is similar, but I will provide a screenshot if it is helpful.

Thanks
0
 
LVL 9

Expert Comment

by:Ishaan Rawat
Comment Utility
try doing it by JQUERY too...

Just add this to your index.php in the starting or the end......

<script>
$(document).ready(function() {
    $("head").append("<?php wp_head(); ?>");
    $("body").append("<?php wp_footer(); ?>");
});
</script>

Open in new window

0
 
LVL 14

Accepted Solution

by:
Dzynit earned 500 total points
Comment Utility
By looking at the screenshot, the header and footer code must be added in the two functions files: skematic-header-functions.php and skematic-footer-functions.php

When you view those in the editor you should see the
</head>

Open in new window

in the header one and the
</body></html>

Open in new window

tags in the footer one. If you don't see that in those two files, you'll have to glance through the other files in the theme until you do find those tags.
0
 

Author Closing Comment

by:MarkJulie
Comment Utility
The final answer from Dzynit pointed me in the correct direction since the standard file called another that was slightly less obvious.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now