You can try this code to show only post.
if(isset($xt_corporate_lite_opt['xt_about_page']) && $xt_corporate_lite_opt['xt_about_page'] != '') {
$args = array( 'post_type' => 'post');
$xt_query = new WP_Query($args);
if ($xt_query->have_posts()) {
while ($xt_query->have_posts()) {
$xt_query->the_post();
the_content();
}
}
wp_reset_postdata();
}
if you have any doubt in WP_Query.
then you could check this link in detail.
Related Posts:
- Storing query variable and then using wp_reset_query
- While creating Block Themes in WordPress, how can I query custom posts for an Archive view?
- Why does get_posts only show results for Admins or logged-out users?
- WP_Query Orderby meta_key and hide some meta_key
- Using something else instead of using 9 wp_query
- Multiple homepage layouts as selected by user from theme options
- wp query problem
- Pagination with custom SQL query
- How to query for most viewed posts and show top 5
- How to list some posts first in the loop based on post id
- Different ‘posts_per_page’ setting for first, and rest of the paginated pages?
- Delete all posts from WordPress except latest X posts
- Custom WP_Query order by post_meta and (author) user_meta
- get_posts with multiple categories
- WP Query to get all posts (including in draft/pending review)
- How to order posts tag by tag?
- Want to redirect if search query match exact title of any post
- Overriding The Loop with filter or hook
- Most commented post should be the first post in the blog
- Perform query with meta_value date
- Custom archive page based on array of categories and tags
- Search another database with wp_query using new wpdb
- Custom page template query_vars
- Compare two meta-fields in a wp_query (where meta-field-A is larger than meta-field-B)
- Different Results with query(‘s=computer’) vs get_posts(‘s=computer’)?
- Why does “Blog pages show at most” interfere with my custom wp_query?
- Recommended way to drop a pending query (in pre_get_posts)?
- How to search for posts IN OR title OR content OR author?
- WP_Query class not found
- Search – Ajax – Alter Query Parameters with Pagination
- Access to Instance Variables from WP_Query
- WP Query with multiple categories – passing an array works?
- Order by menu structure
- SQL User Query by Multiple Roles using PHP
- how to speed up a complex wp_query?
- Exhausted memory limit with very simple WP_Query
- Select from wp_post and multiple meta_value from wp_postmeta
- Multiple Loops Inside a Function
- Sort users by “birthday” using WP_User_Query
- How to use MySQL’s MATCH AGAINST in WP_Query?
- Ajax Pagination on Ajax filter
- Wp_query returning only one post while query through ajax
- only delete post within query / for each statement (front end)
- How to optimize multiple WP_Query() calls on one page?
- How to make “Blog pages show at most” setting not affect custom queries
- Make a page return false to is_single() and true for is_post_type_archive() before wp_enqueue_scripts
- category query for pages not working
- date_query on draft posts only
- How to get list of posts from permalinks?
- How to change main query to only query posts from a single category? [duplicate]
- Pagination for blog posts reloading same page [closed]
- wp_query not working with post_type
- Individual months in WP Query
- how to use pre_gets_posts to exclude one queried ID from homepage loop
- How to check the array values, what WP_Query has brought to me?
- How to Order a list of taxonomies? orderby?
- queried_object using pre_get_posts gets notices and warning
- post_parent don’t work and return 0 page
- date_query in pre_get_posts out of memory
- Combine 2 WP_queries into one (OR relation)
- WP_QUERY wrong ammount of posts
- How to add sort order to incremented and paginated category loop
- One WP_Query that always shows 1 post from category X and 1 post from “not in category X”?
- Loop categories by recent post
- How to add WordPress featured image via SQL
- Meta query with compare by more than 2 fields
- Offset WP_Query by negative 1
- WP_Query orderby random do not repeat infinite scroll – one loop
- How to apply pre_get_posts to a custom query?
- meta_query returning excluded result
- How to pass the current content of $wp_query to a new page?
- WP_Query retuning empty array in rest api
- Query post ordered by meta value that show first post that contained a tag
- WordPress Ajax form filter | Search by title with ajax form, breaks the other filters
- Passing a SQL query to the WP Query
- Why when I using infinity scroll the one post loads over and over?
- Show child by slug, while knowing parent ID
- How can I filter products by meta in Woocommerce REST API?
- Custom WordPress post query for displaying time-released content on website
- WP Query with meta queries
- Slow Query with more 100 products
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- Showing the correct number of posts_per_page when avoiding the use of post__not_in
- Migrating mysqli query to wp_query
- Second WP_Query loop shows data from main query
- My entry results are not consistently alphabetized
- WordPress Bootstrap Grid
- How to order by datediff in WP loop?
- Custom query for tag and custom tag from 2 post type
- wpdb get_results() returns only 2 rows
- WP_Query within save_post doesn’t include the item that triggered the action?
- Search format not matching taxonomy query
- How to display comments list by order when clicking on newest or oldest link?
- Get the number of rows from $wpdb->get_results not working
- Loop issues when creating custom query for media uploader
- Query multiple taxonomies with pagination
- query inside main query order issue
- Stylesheet won’t load even when linked
- Undefined variable [closed]
- Why does $post_id = $wp_query->get_queried_object_id(); return 0?