get_template_part works on one server/host, but not another
-
On my own server, this worked fine:
<?php get_header(); ?> <div id="main"> <h1>Events</h1> <?php query_posts(array('post_type'=>'events', 'paged' => get_query_var('page'), 'posts_per_page' => 10, 'orderby' => 'meta_value', 'order' => 'ASC', 'meta_key' =>'details_date')); get_template_part( 'event-loop', 'events' ); ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
Go to launch, move it over to client’s server, and it won’t work. It breaks the page actually, and the sidebar and footer don’t show up. No error whatsoever, just blank space. “View Source” confirms that all HTML ceases after the “get_template_part” call.
<div id="main"> <h1>Events</h1>
Nothing else after the title.
The same is happening to my “News” page, which also uses “get_template_part” to call a loop. I even moved these files back over to my own server to confirm they worked there, and they do. When I remove the “get_template_part”, my sidebar and footer suddenly appear.
Is there any kind of server configuration that might prevent get_template_part from functioning correctly, or am I missing something more obvious?
I’ve tried updating the permalink structure, removing the query, placing an HTML comment in the first line of the loop file to see if it showed at all (it didn’t). It just honestly doesn’t seem to like the specific get_template_part.
Any help is super appreciated.
- The topic ‘get_template_part works on one server/host, but not another’ is closed to new replies.