Guest User

Untitled

a guest
Jan 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. <?php
  2. $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => 3));
  3. while ( $loop->have_posts() ) : $loop->the_post();
  4.  
  5. $custom = get_post_custom($post->ID);
  6. $product_url = $custom['product_url'];
  7. foreach ($product_url as $key => $value)
  8. echo $key . " => " . $value . "<br />";
  9.  
  10. $custom = get_post_custom($post->ID);
  11. $case_study_url = $custom['case_study_url'];
  12. foreach ($case_study_url as $key => $value)
  13. echo $key . " => " . $value . "<br />";
  14.  
  15. ?>
  16.  
  17. // All my mark-up
  18.  
  19. <?php endwhile; ?>
  20.  
  21. <?php
  22. $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => 3));
  23. while ( $loop->have_posts() ) : $loop->the_post();
  24.  
  25. $product_url = get_post_meta($post->ID, 'product_url', true);
  26. $case_study_url = get_post_meta($post->ID, 'case_study_url', true);
  27. echo "Product: $product_url, Case Study: $case_study_url";
  28. ?>
  29.  
  30. // All my mark-up
  31.  
  32. <?php endwhile; ?>
  33.  
  34. <?php
  35. $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => 3));
  36. while ( $loop->have_posts() ) : $loop->the_post();
  37.  
  38. $all_meta = get_post_custom($post->ID);
  39. foreach($all_meta as $meta_key => $meta_value)
  40. echo "$meta_key: $meta_value<br/>";
  41.  
  42. endwhile;
  43. ?>
  44.  
  45. <?php
  46. $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => 3));
  47. while ( $loop->have_posts() ) : $loop->the_post();
  48. $foo = get_post_meta($post->ID, 'Foo');
  49. print_r($foo);
  50. endwhile;
  51. ?>
Add Comment
Please, Sign In to add comment