Of course there is. Just do it like this:
$sticky = get_option( 'sticky_posts' );
$args = array(
'post_type' => 'mission',
'ignore_sticky_posts' => 1,
'orderby' => 'date',
'post__not_in' => $sticky,
'posts_per_page' => $count
);
$latest_missions = new WP_Query( $args );
if ( $latest_missions->have_posts() ) {
echo '<ul>'; // prints opening ul tag before list items
while ( $latest_missions->have_posts() ) {
$latest_missions->the_post();
get_template_part( 'content-list', get_post_format() );
}
echo '</ul>'; // prints closing ul tag after list items
wp_reset_postdata();
}
Related Posts:
- Is there any way to use get_template_part() with folders?
- Is it possible to override the result of get_template_part()?
- Get template part vs locate template function
- Templates & CSS – Proper Programming Practice?
- TwentyTen: Overloading template.php files vs. get_template_part
- Passing variables to template parts
- How to move style from template file to section?
- Unable to include a template
- Where is the template for the ‘standard’ format of a post in the theme twentythirteen?
- Remove portion of header code from home page only
- Use a separate template for the home page only
- How to create new template page and template-parts in wordpress theme [closed]
- Including template pages within another template?
- Organize template parts and page templates in folders in regards of template hierarchy
- How to get all template files used for rendering a single post/page?
- get_template_part for template in subdirectory not working
- Display a custom 404 page without a redirect
- How can I show contents of a template part inside of another page?
- When to use content-pagename.php?
- Is it possible to call a template file inside wysiwyg editor? And how?
- WordPress “Blog” template hierarchy
- Adding Page Attributes Metabox and Page Templates to the Posts Edit Page?
- Is there a way to list all used/unused WP templates?
- Print WordPress template filename(s) for debugging
- How to add custom content template part for a custom post type on main query using a plugin
- Change the name of the ‘Default Template’
- Echoing Elementor page content in template, but it doesn’t get styles and some widgets are missing
- How can I modify the default reset (lost) password email text?
- Template files missing after moving site
- Grid layout “last” class to every third item
- How do you modify Page Template?
- Using “setup_postdata” with “get_template_part” does not work
- How can I get the content of the home page?
- Why aren’t my posts showing?
- How to display error on specific template?
- What is content.php file that is needed for Jetpack infinite scroll plugin?
- Auto-Generate Longtail-SEO Pages/URLs
- bloginfo(‘template_directory’) img src
- Should template files be copied to the child theme for editing?
- Calling an image within the theme folder from inside a post/page?
- Best Constant to use to check if WordPress is running
- WordPress automatically created files like .theme-name / .plugin-name.php [closed]
- style sheet header on Page Templates
- Why does the Full-width Template in Twenty Twelve pack so many classes into the body class attribute?
- Conditionally display different images before the content in a page template
- Show all parts in multipage post
- One of my pages uses the archive.php template only. Why?
- Why are 404s not triggering my 404.php template?
- Is there a way to create a block template that is not limited to a post type?
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- link to non-category page routed to category template
- Can’t format content of Rich Text Editor in Template
- get_file_data to read data for Custom Template File?
- Remove Items from Template Homepage
- Bizarre issue with custom RSS template
- Using shortcode in template file
- Display current category and child
- Return get_header and get_footer string instead of echo it
- Different templates for same content, landing page from different URLs (generic, simple)
- Use one template only for custom post type archives?
- Is there a more efficient way to loop through pages?
- Is it possible to register a new template file?
- What template is used for viewing Media Library Files?
- Create a blank test.php
- How do I remove the word “Blog” from a WordPress Homepage?
- How to use template inside plugin shortcode with variables for big HTML code
- AMP version of front page without plugin
- Give wp link pages it’s own template
- /wp-admin/post.php shows 404 template on submit
- Which template.php for /blog
- List Category Posts plugin – underline links [closed]
- Conditional template tag for buddypress pages
- Need help with my template [closed]
- WordPress Template Reverts to default template after changing
- using add_filter in a template_redirect function?
- How does post loop integrate individual page elements
- Content not showing properly with the first load of the page
- Where do I edit what the user sees on my WordPress site?
- User role templates
- Using a SendGrid transactional template with wp_mail
- Language file doesn’t work (poeedit)
- How to adjust only the template gallery
- Nested Page Template not showing in page attributes
- Header and footer fail to load with SSL and custom links
- Creating page-templates directory breaks everything!
- Editing the tag pages and using templates
- Using require_once for parent-directory not working but is working in sub-directories
- Problem displaying replies as part of author’s latest comments on author page
- custom template – override plugin template in child theme – issue with scripts
- Is it better practice to create many page templates, or a a few base templates with custom HTML added via TinyMCE?
- Add pagination to blog
- Choose to show or not show title on a template?
- Add multiple pages to theme customizer
- Single Post Template with Dropdown Option?
- Single template will not show sidebar/bottom-nav and footer
- Output fields manually in Woocommerce email templates
- Templates to use multiple time within page? [closed]
- Custom template pagination
- My homepage’s width has reduced and I can´t fix it [closed]
- How to duplicate a template in wordpress site editor?