DidouS

Meta Box Views: Show posts in other CPT

Apr 1st, 2021
549
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {%
  2.     set args = {
  3.         'post_type' : 'yourposttype',
  4.         'numberofposts' : 10,
  5.     }
  6. %}
  7. {% set posts = tb.get_posts( args ) %}
  8. {% if posts|length %}
  9.     {% for item in posts %}
  10.         <div>
  11.         <h3>{{ item.post_title }}</h3>
  12.         {{ item.post_content }}
  13.         </div>
  14.     {% endfor %}
  15. {% else %}
  16.     <h3>There are no posts.</h3>
  17. {% endif %}
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×