You can use WP_Query
<?php
$args = array(
"post_type' => 'faq',
'post_status' => 'publish',
'order' => 'DESC',
'orderby' => 'date',
'posts_per_page' => -1
);
$query = new WP_Query( $args );
if( $query->have_posts() ): ?>
<ul id="myUL" class="margb-40">
<?php while( $query->have_posts() ): $query->the_post(); ?>
//content
<?php
endwhile; ?>
</ul>
<?php
wp_reset_postdata();
endif;
Related Posts:
- Counting the posts of a custom WordPress loop (WP_Query)?
- Get post content from outside the loop
- How to split a loop into multiple columns
- Is it necessary to reset the query after using get_posts()?
- Is there any difference between the_title() and echo get_the_title()?
- Pagination not working on home page
- Get post by page name or slug
- save_post + insert_post = infinite loop
- Get ID of a page containing secondary loop in content
- is_home, and is_front_page conditional problem
- Is `query_posts` really slower than secondary query?
- ACF Repeater loops and resets – where is the reset_rows() documentation? [closed]
- What is best way passing variables to theme templates and using them different places like widgets?
- Apply styling only to first page sticky posts
- Exclude category by slug for for each loop
- pop-up lighbox with AJAX
- WordPress Loop Through Particular Pages
- Display date only once for a each set of posts relating to that date
- Load comments per post on click with AJAX
- The main Loop is not starting in a custom blog template page
- connect last post with first post
- Chopping up a large ajax request of around 200 posts [closed]
- Combining the_excerpt with the_content
- Custom loop with conditional statement to separate each terms
- taxonomy tags 404 to custom post types
- Breaking the loop?
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- woocommerce stored variable
- Get search.php results in header.php?
- Recent posts on a static home page
- I write simple wordpress loop for taxonomy.php file but don’t show result
- A smarter way to display multiple loops inside a page template
- How to print out menu names in the foreach loop?
- How do I style the first two posts of a loop
- Do I need to use The Loop on pages?
- How to get the role id from the role name?
- How do I paginate a get_posts() request inside another page loop (Paginating childpages)
- Is wp_reset_postdata() redundant after the main loop?
- Exclude first post (sticky or not) from the loop using query_posts()
- How to add a specific div element to the first post in a row?
- While loop with bootstrap [closed]
- Need to add class to first element in a foreach loop
- Scrolling Posts with Ajax
- Sort posts by first letter in the title, not by first number
- How to create a multidimensional array with multiple loops
- how to replace get_template_part(‘loop’,’tag’) with explicit styled version?
- What PHP Needed to Make One Loop with Multiple Styling?
- Simple foreach loop help needed in wordpress “the loop”
- How to create custom popup in shop page on every loop products?
- Getting posts link in WordPress
- Loop through an array inside a class using foreach [closed]
- using wp_get_attachment_image_src in foreach loop
- Grabbed Post ID under WP loop, but still couldn’t Print Post title
- Why the first with flexslider appears as blank on my code?
- Rendering pages
- add_action in the loop hooks
- How can have a conditional template tag based on the main loop within a secondary loop with new WP_Query(), using get_template_part()
- How to render the single post template with the post name?
- Reset Loop get_posts();
- WP_Query is only looping home page, not pages
- How to filter posts by category INSIDE the loop
- Offset Loop by 1 , Limit next loop to 1 (Most Recent) Post
- Help with if and else statement
- How to show multiple attachements together with Scribu’s Posts 2 Posts connector?
- Custom Header added within Dashboard pages, is this possible with custom template files?
- Loop order issue with Ajax filter
- Database query and get_user_meta return incorrect data
- Adding a second loop breaks everything
- Need to while loop and display contents in the subfield of a group field given by ACF
- Custom Query with Sticky Posts
- How to display a loop of custom post types in columns
- is it bad to copy the loop for a template?
- I want to load post in bootstrap Modal dynamically
- dispaly all hierarchical post types from a taxonomy
- WordPress Modal showing posts not working properly
- Query posts and display all dates in repeater field in chronological order
- Return only one post format in index.php [duplicate]
- How to display just video post format?
- Multiple loops in set intervals with code in between
- Attachment Metadata inside of Loop
- Modify widget to output posts in custom order
- How to execute custom loop before loop content?
- Template included with plugin doesn’t return all posts for custom taxonomy
- Sorting posts to make those with post thumbnail show up first
- Limit article to 100 characters. Can’t use the_excerpt…
- Return only content in excerpt field in loop
- Adding pagination to WP_Query [duplicate]
- Insert/sticky multiple posts in multiple positions
- This webpage has a redirect loop issue with SSL page
- Buddypress Group Activity Loop Filter activity type [closed]
- get_posts and wp_autop (remove filter)
- Trouble preventing duplicate posts between 2 loops on homepage
- Stuck with conflicting loops on page template
- Show amount of posts created today above loop?
- How to create WordPress loop with combination of 4 and 2 columns twitter-bootstrap?
- posts_nav_link() not working on index.php
- How to add custom HTML markup and classes to the_content()?
- $do_not_duplicate is not working in genesis theme
- Loop displays current page
- Hook in the loop after the first post