Answers for "get custom posts wordpress"

0

wordpress get all custom posts

$posts = get_posts([
  'post_type' => 'custom',
  'post_status' => 'publish',
  'numberposts' => -1
  // 'order'    => 'ASC'
]);
Posted by: Guest on July-23-2021
0

display a list of WordPress custom posts

<?php $loop = new WP_Query( array( 'post_type' => 'article', 'posts_per_page' => 10 ) ); ?>

<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

    <?php the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h2>' ); ?>

    <div class="entry-content">
        <?php the_content(); ?>
    </div>
<?php endwhile; ?>
Posted by: Guest on July-23-2021

Code answers related to "get custom posts wordpress"

Browse Popular Code Answers by Language