Second query works on localhost but not on server – what have I done wrong?
-
It used to work. I’m not sure when it stopped working, unfortunately. I do know that it was before the upgrade to 4.4, because I just did that today. I’ve isolated the problem to be the 2nd query — the page stops loading after “Our Varied Practices Meet Your Needs” on the live server, but works perfectly when that chunk is removed.
But again, on my localhost, it works beautifully. I’m hoping there’s something obvious and dumb that I did that newer versions of wordpress won’t tolerate.
I’d appreciate any words of wisdom!
<div id="content" class="grid_13"> <?php if (!dynamic_sidebar('Alert')) : ?> <!--Wigitized 'Alert' for the home page --> <?php endif; ?> <h1>Committed to <br />Our Clients</h1> <div class="column front-left"> <div class="news_headlines_home"> <h2>Firm News</h2> <ul> <?php $args = array( 'cat' => 24, -33, 'posts_per_page' => 5, 'order' => 'DESC', 'post__in' => get_option('sticky_posts'), 'ignore_sticky_posts' => 1 ); $posts = query_posts($args); if (have_posts()) while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> <div class="smaller"> <?php if (is_mobile()) { get_sidebar('home'); } ?> </div> </div><!--end news headlines --> <div id="photo-row"> <h3>Our Varied Practices Meet Your Needs</h3> <?php $lawyer_profiles = get_posts('post_type=lawyer_profile&orderby=rand&numberposts=7&cat=-46'); foreach ($lawyer_profiles as $post) { $lawyer_name = get_the_title(); $first_name = substr($lawyer_name, 0, 15); ?> <div class="photo-block"> <?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'secondary-image'); endif; ?> <div class="bar"></div> <h5 class="lawyer-name"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5> <?php $practice_area_select = types_render_field("practice-area-select", array("raw" => "true")); echo '<h4 class="practice-name ' . $practice_area_select . '">'; // $practice_area_term = get_term_by('name', $practice_area_select, 'practice-area'); echo '<span><a href="' . home_url() . '/practices-home/' . sanitize_title($practice_area_select) . '">' . $practice_area_select . '</a></span>'; echo '</h4>'; ?> </div> <?php } wp_reset_query(); ?> <div class="clearfix"></div> </div> <!-- end photo-row-->
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Second query works on localhost but not on server – what have I done wrong?’ is closed to new replies.