Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rahuladams/e582b0097ecf60e6dec720dfd75d5d11 to your computer and use it in GitHub Desktop.
Save rahuladams/e582b0097ecf60e6dec720dfd75d5d11 to your computer and use it in GitHub Desktop.
How to display Custom Post Type UI content in the theme.
<?php
$args = array(
'post_type' => 'cptui_post_slug',
'posts_per_page' => 10,
'orderby' => 'meta_value_num',
'order' => 'ASC',
'paged' => $paged,
);
$post_name = new WP_Query( $args );
?>
<?php if ( $post_name->have_posts() ) : ?>
<?php while ( $post_name->have_posts() ) : $post_name->the_post(); ?>
// Call title, content, ACF fields here..
<?php endwhile; endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment