Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   wp_footer not called in front-page.php (http://forum.bytesforall.com/showthread.php?t=20493)

marklevine Jun 12, 2013 08:18 AM

wp_footer not called in front-page.php
 
I am using a custom front page, having added front-page.php in my child theme directory. The code is based on index.php from the Montezuma directory. I added some styles and a loop to create a special navigator at the top of the center column. Below the navigator there is a standard loop where I display the_content for the first three posts and the_excerpt for all the rest. (Note: I removed any template processing for this file by copying the code for postformat.php and inserting it directly into front-page.php.)

At the bottom of front-page.php, I call get_footer() which is correctly inserting footer.php into the bottom of the file. BUT! This is not calling wp_footer().

Symptoms include: the wordpress admin bar doesn't appear at the top of the front page for administrators. Also, scripts enqueued for the footer are not inserted into the php for the front page. This is breaking slideshows. This is all working properly for archive, single, and page pages which are served with the standard Montezuma index.php.

My expectation is that the call to get_footer() ought to result in a call to wp_footer() but this is not happening. I'm digging and digging and digging. I'm afraid I'll reach China before I figure out what my php is missing! Thanks for any suggestions.

marklevine Jun 12, 2013 08:22 AM

By the way, if I manually add a call to wp_footer() below the call the get_footer(), the front-page.php file works correctly. However, I suspect that there is something wrong with my configuration because I believe that I should not have to make that call.

juggledad Jun 12, 2013 12:03 PM

Why are you doing this?

jerryc Jun 14, 2013 11:49 AM

Try breaking what you're doing into smaller chunks. For example, take out your loop and all your special things, and see if you still have the problem. Then put things back in one at a time and see what's causing your problem.

marklevine Jun 15, 2013 08:35 AM

@juggledad, I am migrating this client from an Atahualpa-based theme to Montezuma. I was using the feature of Atahualpa to show the first "n" posts in full text (the_content) and the remaining posts as excerpts. I could not find a way in Montezuma to replicate this so I built my own loop in a custom front-page.php. Within that loop, I count which post I'm on and use the_content() if I'm on the first page on one of the first three posts.

When I first tested front-page.php, I noticed that the WP admin bar didn't display. I tracked this back to the lack of a call to wp_footer(). But I read somewhere that the call to get_footer() ought to make the call down to wp_footer(). This is not happening in my template.

The site has launched at http://artsmeme.com

juggledad Jun 15, 2013 10:43 AM

if you look at the physical 'index.php' you will see a call to wp-footer. If you are making a template, you need to add that in.

marklevine Jun 15, 2013 07:07 PM

Thanks. I have already added a call to wp_footer() and I will keep it. I believed that I found some documentation that stated that a called to get_footer would suffice. I am satisfied that my code, as written, is correct.


All times are GMT -6. The time now is 06:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.