Try below code
index.php
<?php
$args = array(
'post' => 'people',
'post_status' => 'publish'
)
query_posts( $args ); ?>
<?php if ( have_posts() ) : ?>
<!-- the loop -->
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content-templates/content', 'people' ); ?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part( 'content-templates/content', 'none' ); ?>
<?php endif; ?>
content-people.php
<div class="col-lg-3 col-md-6 text-center">
<div class="service-box">
<i class="fa fa-4x fa-diamond text-primary sr-icons"></i>
<h3><?php the_title(); ?></h3>
</div>
Hope this will helps you.
Related Posts:
- Get Custom post with ID
- WP_Query to loop a Custom Field, Custom Post Types do not show
- Posts in Multiple Columns and Rows with one single loop
- How do I write this SQL statement for Posts written in last 24 hours?
- Alphabetical sorting of custom post type – one letter per page
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- How to show posts from multiple post types in a single loop? And display them separately on the same template
- How to display the rest of categories on Portfolio filterable
- Get_post_meta() won’t return value
- Query Custom Post by Category
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- ‘category__and’ for custom taxonomy?
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Display custom post on home page based on a metabox selection
- Lists Posts from CPT that match the Title of the Page
- get_template_part for custom post type content not working
- get_template_part() – post-meta not working?
- Creating Accordians in WordPress Theme
- How to insert content from another Custom Post type into Post?
- Display different content on homepage depending on post type
- How to call custom single post?
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- WP_Query orderby modified to include custom meta changes
- get_attached_media() on author page not working
- Calculate all custom field values in the post loop
- I would like to have different styles for my posts based on the content of each post
- Checking if Post Title is Unique as Loop Criteria
- Custom post type multiple loop by taxonomy term
- List custom taxonomy specific to one custom post type
- Paging doesn’t work?
- Custom post type, organized by categories
- What’s the WP way to load remaining custom posts?
- What to and how to proceed with CPT to make DB small and efficient?
- A custom post within a custom post
- Display custom post type posts first, then default posts
- get_the_title() is returning results from previous loop
- Including all post id’s of a custom post type into an array
- How can I group posts by months and years?
- Multiple Custom Post Type queries, how to DRY it up
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- 3 random images from custom post type, each in a div with a diffrent class
- Displaying multiple post types on home page
- Shortcode leaves no space for other elements?
- Loop through posts of only 2 statuses
- Query to get child pages of current page and display it in action hook
- Get post format
- Display post from custom post type
- WordPress giving a 404 page when passing a year argument different than the current year
- Add Class according to the order of appearance
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- Permalinks for single-[custom-post-types] not working
- Drop down list with posts within the “add new” page
- How to show custom post type on homepage and in categories
- using the loop in custom meta is messing up ‘add new’ post type
- How can I loop at a Specific Taxonomy from a custom post type?
- Custom archive page for custom taxonomy and pagination issue
- Update query based on CPT / Post Type, show all sorted by date
- WordPress next post by ajax call on button click
- How to avoid duplicate posts queried from custom meta?
- Why do my custom post type show up in all pages?
- Looping to organize and display custom posts by category using PHP and WordPress
- Pagination for a cpt filtered with a category
- My post loop needs to have 8 different post templates
- Multiple Custom Post Type in Taxonomy Archive Causing White Screen
- Adding a Section for Visitors
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- Show parent category and subcategory once in while loop
- Mix Facebook and Twitter feed into custom posts
- How to build Custom Post Nav Menu inside of the Loop
- Loop to display parent categories in custom taxonomy
- Infinite scroll doesnt work
- Display related post content and custom field content
- Excluding category from loop not working
- 2 custom posts types, in their own columns, one pagination for both
- WordPress loop, show only one post per custom field
- How To Loop Through list with Custom Post Types
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- Multiple loops for custom post type to spread data across rows
- Pagination on custom post types
- Custom Post Type + Category archive
- Loop multiple taxonomy in custom post
- $post breaking container loop
- Post data in separate divs with incrementing class using WP_Query
- Redirection loop error after login from a custom post type post
- Posts without featured image using other post’s featured image
- Get result from Custom Field in Custom Post type
- Nested loop called with shortcode duplicating the content above the main loop
- Custom post-type’s pagination not working in category.php
- Pulling in a particular post into a single page based on the post id passed into the code
- why get_post_meta is returning 0?
- Post_type doesn’t work for widgets?
- How do I correctly query posts from a post ID?
- Get Posts From A Certain Post Type In An ID Array
- Show search for data extracted from metabox
- why does my post loop break the page?
- display all posts in current category
- Get all active posts that are tied to a custom taxonomy for a custom post type
- WordPress search results grouped by post type
- How to print different informations for different post types inside The Loop?