Answers for "how to get custom post type data in wordpress"

PHP
0

wp_query custom post type

//WordPress: Query a custom post type
//For example, query all Case Study post types

<?php query_posts('post_type=case_studies'); ?>
Posted by: Guest on January-14-2020
0

wordpress custom post type Query

<?php 
    query_posts(array( 
        'post_type' => 'portfolio',
        'showposts' => 10 
    ) );  
?>
<?php while (have_posts()) : the_post(); ?>
        <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
        <p><?php echo get_the_excerpt(); ?></p>
<?php endwhile;?>
Posted by: Guest on June-07-2021

Code answers related to "how to get custom post type data in wordpress"

Browse Popular Code Answers by Language