Advertisement
rakeshr

unique custom fields value still not working

Feb 14th, 2012
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  <?php
  2.   query_posts( array( 'post_type' => 'post', 'showposts' => 10 ) );
  3.   if ( have_posts() ) : while ( have_posts() ) : the_post();
  4. ?>
  5.          
  6.          
  7.                 <?php $judges = get_post_meta($post->ID, 'judge', false); ?>
  8.  
  9.  
  10.  
  11.     <ul>
  12.         <?php foreach($judges as $judge) {
  13.            
  14.            
  15.             echo '<li>'; ?>
  16.             <a href="<?php echo esc_url( home_url( '/' ) ); ?>judge/<?php echo get_post_meta($post->ID, 'judge', true) ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
  17.            
  18.             <?php echo $judge; ?>
  19.             <?php  echo '</a></li>';
  20.            
  21.            
  22.            
  23. } ?>
  24.     </ul>
  25.    
  26.  
  27.    
  28.             <?php endwhile; endif; wp_reset_query(); ?>
  29.  
  30.  
  31.  
  32.  
  33.  
  34. <h1>Following is new code being tested</h1>
  35.            
  36.            
  37. <?php            // The Query
  38. $the_query = new WP_Query( 'meta_key=participate' );
  39.  
  40. // The Loop
  41. while ( $the_query->have_posts() ) : $the_query->the_post();
  42.    
  43.      $judges = get_post_meta($post->ID, 'judge', false); ?>
  44.     <ul>
  45.         <?php foreach($judges as $judge) {
  46.            
  47.            
  48.             echo '<li>'; ?>
  49.             <a href="<?php echo esc_url( home_url( '/' ) ); ?>judge/<?php echo get_post_meta($post->ID, 'judge', true) ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
  50.            
  51.             <?php echo $judge; ?>
  52.             <?php  echo '</a></li>';
  53.            
  54.            
  55.            
  56. } ?>
  57.     </ul>
  58.    
  59. <?php endwhile;
  60.  
  61. // Reset Post Data
  62. wp_reset_postdata();
  63.      ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement