Advertisement
Guest User

switch-cpt

a guest
Mar 8th, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2.  
  3. switch_to_blog(152);
  4.  
  5.  
  6. $args = array (
  7.  
  8. 'post_type' => 'faculty_profile',
  9. 'orderby' => 'meta_value',
  10. 'meta_key' => 'sortby',
  11. 'order' => 'ASC',
  12. 'posts_per_page' => -1,
  13. );
  14.  
  15. query_posts( $args );
  16.  
  17.  
  18. if ( have_posts() ) : while ( have_posts() ) : the_post();
  19.  
  20. echo "<p><strong>";
  21. echo '<a href="' . get_permalink( get_the_ID()  ) . '">';
  22. the_title(); echo "</a></strong><br />";
  23. echo '<em>' . get_post_meta(get_the_ID(), "faculty-title", true) . '</em>';
  24. echo "<br />";
  25. echo nl2br(get_post_meta(get_the_ID(), "degrees", true));
  26. echo "</p>";
  27. endwhile; else:
  28. echo 'No faculty in this department or program.';
  29. endif;
  30.  
  31. //Reset Query
  32. wp_reset_query();
  33.  
  34. restore_current_blog();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement