• Resolved webmistress666

    (@webmistress666)


    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Do you have access to your client’s server’s logs? If so, are there any errors showing? Is WP debugging on?

    Thread Starter webmistress666

    (@webmistress666)

    Oh holy god, WP Debugging was false. Setting to true gave me the error I was looking for. Easy fix. Was missing a ‘php’ in ‘<?php’.

    I’m going to go hide in shame now.

    Thanks so much for the advice!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_template_part works on one server/host, but not another’ is closed to new replies.