Advertisement
Guest User

WP_Query error

a guest
May 4th, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.19 KB | None | 0 0
  1. <?php
  2. /*
  3. This is returning me a blank page. This page is loaded using a jQuery Ajax call. It used to work before when it was added in the main page. What may be the problem?
  4. */
  5.  
  6. <?php
  7. define('WP_USE_THEMES', false);
  8. include('../../../wp-blog-header.php'); // the path is correct, I verified it
  9. include('../../../wp-load.php');
  10. ?>
  11. <div class="apple">
  12.     <?php $loop = new WP_Query(array('post_type'=>'members')); ?>
  13.     <ul>   
  14.         <?php while ($loop->have_posts()) : $loop->the_post(); ?>
  15.    
  16.         <?php
  17.             global $post;          
  18.             $type = get_post_meta($post->ID, 'type', true);
  19.             if($type=='overseas')
  20.             {
  21.                 $short_intro = get_post_meta($post->ID, 'short_intro', true);
  22.                 $phone = get_post_meta($post->ID, 'phone_ord', true);
  23.                 $website = get_post_meta($post->ID, 'website_ord', true);
  24.         ?>
  25.         <li>
  26.             <span class="heading"><?php the_title(); ?></span>
  27.             <p><?php echo $short_intro; ?></p>
  28.             <span class="phoneWebLink"><span>Phone:</span><?php echo $phone; ?><span class="pl10">Web: </span><a href="<?php echo $website; ?>"><?php echo $website; ?></a></span>
  29.             <a href="<?php the_permalink(); ?>">Read more</a>
  30.         </li>
  31.         <?php } ?>
  32.         <?php endwhile; ?>
  33.     </ul>
  34. </div><!-- //alphabetListH -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement