wp_head content not being added to home page
I installed “Add to All” v1.0.4 and added some content (below) to the Any other HTML (no PHP) to add to wp_head: section:
Note: Part of the code has been cut out and replaced with “…”. Searching on “silverpop” should find this though.
This code appears in the HTML for all the site’s pages EXCEPT for the main page (home page). The URL for the site is http://test.ipc-global.com.
Can you check if your theme’s home page file has a wp_head hook. It seems like it is there in your single and page templates but not in the homepage.
Although I’ve been using WordPress for two years, I’m not an expert, so I’m not sure if I understand your question. Also, I am new to this WP installation. We have a custom theme (ipcglobal).
I found wp_head in header.php for the theme. Does this help?
/var/www/ipcglobal/wp-content/themes/ipc-global$ grep wp_head *php
header.php: <?php wp_head(); ?>
If not, then let me know what to search for, and I will try to find it.
wp_headthat you found in the header is correct and needs to be included. I think this is driving all your posts and pages.
Do you know if this header.php file is used in the home page. Depending on the theme the file name can change.
Do you have any files named here:
Thanks Ajay. I am checking into your request. I should have some info soon. I did find this though under “Manage Themes”:
The 2010 theme for WordPress is stylish, customizable, simple, and readable — make it yours with a custom menu, header image, and background. ipc-global supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the “Asides” and “Gallery” categories, and has an optional one-column page template that removes the sidebar.
So it looks like our theme was based on 2010.
The link you provided has a lot of things to check for. I’m not sure exactly what to check. I found front-page.php, but it’s under the twentytwelve sub-directory, so I don’t think it’s being used. I found index.php and confirmed that it is being used. Should I modify this? If so, then what should I add?
srikumar@ip-10-0-2-45:/var/www/ipcglobal$ find . -name front-page.php
srikumar@ip-10-0-2-45:/var/www/ipcglobal$ ls -al index.php
-rw-r–r– 1 www-data www-data 418 Mar 28 08:08 index.php
srikumar@ip-10-0-2-45:/var/www/ipcglobal$ cat index.php
* Front to the WordPress application. This file doesn’t do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
* @package WordPress
* Tells WordPress to load the WordPress theme and output it.
* @var bool
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );
I found wp-blog-header.php (which calls wp-load.php) and wp-load.php too.
srikumar@ip-10-0-2-45:/var/www/ipcglobal$ ls -al wp-blog-header.php
-rw-r–r– 1 www-data www-data 271 Mar 28 08:08 wp-blog-header.php
srikumar@ip-10-0-2-45:/var/www/ipcglobal$ ls -al wp-load.php
-rw-r–r– 1 www-data www-data 2359 Mar 28 08:08 wp-load.php
Do you know what the name of the theme is? If so, you need to be only checking within that themes folder. I assume this is (ipc-global)
Do you have a home.php or front-page.php in this folder?
You are correct: It is ipc-global. It looks like I don’t have either file in that directory:
srikumar@ip-10-0-2-45:/var/www/ipcglobal/wp-content/themes/ipc-global$ ls -al home.php
ls: cannot access home.php: No such file or directory
srikumar@ip-10-0-2-45:/var/www/ipcglobal/wp-content/themes/ipc-global$ ls -al front-page.php
ls: cannot access front-page.php: No such file or directory
I copied front-page.php from the twentytwelve theme to the ipc-global theme. My snippet is now being inserted into the home page. The bad news is the home page looks a lot different from before. See for yourself:
I’m not sure what file to modify/move/etc to get it to work correctly.
Another update. I found part of the missing homepage (homefooter.php).
I added “<?php include (TEMPLATEPATH . ‘/homefooter.php’); ?>” to front-page.php, but it didn’t seem to do anything though. 🙁
root@ip-10-0-2-45:/var/www/ipcglobal/wp-content/themes/ipc-global# grep Seeing *php
homefooter.php: <h2>Seeing is Believing – Download QlikView Now!</h2>
- Seeing is Believing
root@ip-10-0-2-45:/var/www/ipcglobal/wp-content/themes/ipc-global# grep homefooter *php
index_14_03_13.php:<?php include (TEMPLATEPATH . ‘/homefooter.php’); ?>
index.php:<?php include (TEMPLATEPATH . ‘/homefooter.php’); ?>
I just did this:
root@ip-10-0-2-45:/var/www/ipcglobal/wp-content/themes/ipc-global# cp index.php front-page.php
The homepage looks normal again, but the tracking code disappeared. What do you recommend?
The way your theme is structured, I don’t think you need to add a front-page.php at all since it would break the theme.
Do you have a file header.php or homeheader.php in your theme folder?
One thing is clear is that your index.php seems to be missing the tracking code. But, it could be a simple error in the theme.
Do you think you can paste the code in index.php and the header file (if any) into snipts at http://snipt.org/
I can view the code and suggest a change.
I apologize for the delay in responding. I just put header.php and index.php into snipt.org. I made them both private, and my twitter handle is LarrySchauerIPC. I’m not sure if they were checking in correctly though.
Also, how will you be able to see the files?
- The topic ‘wp_head content not being added to home page’ is closed to new replies.