Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. <?php
  2. $author_id = get_the_ID();
  3. $single_books_query = new WP_Query(array(
  4. 'post_type' => 'post',
  5. 'category_name' => 'books',
  6. 'meta_query' => array(
  7. array(
  8. 'key' => 'ecpt_pub_author',
  9. 'value' => $author_id,
  10. 'type' => 'NUMERIC',
  11. 'compare' => '='
  12. ),
  13. 'posts_per_page' => '-1'
  14. )));
  15.  
  16.  
  17. if ( $single_books_query->have_posts() ) : while ($single_books_query->have_posts()) : $single_books_query->the_post(); ?>
  18. <a href="<?php the_permalink(); ?>">
  19. <?php if ( has_post_thumbnail()) { the_post_thumbnail('directory', array('class' => "floatleft")); } ?>
  20. <h5><?php the_title();?></h5>
  21. <h6><?php if ( get_post_meta($post->ID, 'ecpt_pub_date', true) ) : echo get_post_meta($post->ID, 'ecpt_pub_date', true); endif; ?><?php if ( get_post_meta($post->ID, 'ecpt_publisher', true) ) :?>, <?php echo get_post_meta($post->ID, 'ecpt_publisher', true); endif; ?></h6>
  22. <p><b>Role:&nbsp;<span style="text-transform:capitalize;"><?php echo get_post_meta($post->ID, 'ecpt_pub_role', true); ?></span>
  23.  
  24. //This is the line that isn't working:
  25. <?php if (get_post_meta($post->ID, 'ecpt_author_cond', true) == 'on') { $faculty_post_id2 = get_post_meta($post->ID, 'ecpt_pub_author2', true); ?><br>
  26. <?php echo get_the_title($faculty_post_id2); ?>,&nbsp;<?php echo get_post_meta($post->ID, 'ecpt_pub_role2', true); ?>
  27. <?php } ?>
  28.  
  29. </b></p>
  30. </a>
  31. <hr>
  32. <?php endwhile; endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement