Based on this…
… I just want to show the excerpts (until the more tag).
… it sounds like what you want is to show the post content up to the <!--more-->
tag, rather than the excerpt proper which is hand-written into a special field. To do that, you need to use the_content()
/get_the_content()
rather than the excerpt
cousin functions, and you need to have the global
variable $more
set correctly, but that is not hard to do.
$q = new WP_Query(array('post_type'=>'post'));
global $more;
while ( $q->have_posts() ) {
$q->the_post();
$more = 0;
$the_exc = get_the_content();
echo $the_exc;
}
Related Posts:
- has_excerpt() not working inside wp_query
- Remove ellipsis from the excerpt retrieved using get_the_excerpt()
- How to find a post id using the post_excerpt?
- Return only post(s) which have post_excerpt
- $WP_Query: How to display excerpt on first post only
- the_post() within switch_to_blog() altering my excerpt
- how can I get seperate the HTML in the_content(); output?
- Differentiate Nested WP_Query from Parent
- How to split a post and intercalate elements from a loop
- Display specific page (that is child) content on parent page
- custom page with post content using read more
- Why does apply_filters behave different inside and outside a loop?
- Links in the_content not linked
- custom excerpt is not being shown
- Insert wp_query after the_content with plugin (filter the_content won’t work)
- Can’t get the_content to show
- the_excerpt() not working in custom archive
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- Using get_posts vs. WP_Query
- How to Access Global $multipage or Global $numpages outside the loop?
- How can I use WP-CLI commands without –allow-root
- Merging a complex query with post_rewind and splitting posts into two columns
- WP_Query in a shortcode
- ‘posts_where’ filter not applying ‘WP_Query’ in `wp_ajax`
- Get all posts without tags
- Filter wp_query to search post title in function
- Two queries on the same page with pagination
- Best approach to create Hot and Trending sections
- creating wp query with posts with specific category
- get complex results set according to category structure
- Setup of taxonomy term template pages
- Ignore post by meta value in the main query
- Display posts in 3 days chunk
- how to get the id for a post from within a post and return post meta for it
- WP_Query’s “request” SQL Query
- How to make this WP_Query run faster on a WordPress website?
- Order taxonomy terms in alphabetical order
- is_search was called incorrectly
- Empty tax_query array returns an empty array
- How do I sort posts with multiple pages
- Sorting By Custom Posts With Attachments
- How to choose between hooking into per_get_posts or into parse_query
- How to set pagination to work with ‘/page/’?
- How to do meta_query for attachments?
- How can I fix: “Notice: Undefined offset: 0”?
- Most commented last 24h, week, month, year and all time – posts_where
- WP_Query Pagination on multiple-loop page breaks WP or doesn’t show up
- Why isn’t my `meta_query` array functioning properly?
- How to duplicate 5 posts out of WP_Query results?
- WP_query sorting can’t sort danish letters (æ, ø, å)
- Dynamic User Id
- Slow queries on a huge database
- Multisite pagination issue by multi query archive 404
- get_post_meta slowing down my page load (in a plugin)
- Hide elements outside loop based on query
- How can i share WP_Query between multiple functions?
- sort and display posts by custom field (wp-query and the loop))
- I need help using pre_get_comments to limit comments in the comments admin screen
- WP_query only displays one of my custom post type entries
- Issues with search after added meta_query
- How to load a script code only in posts?
- Woocommerce: order posts by meta key
- Modify query posts
- query post by author gender
- How do I add an item to the WP admin menu?
- Multiple meta query from array
- Which is from this queries is more faster
- Start Query from 2nd Post without offset
- Related posts by current posts child category
- Trying to change category of wp_query
- Any quicker alternative for WP_Query “NOT IN”
- duplicated posts when using pagination
- How to use the Term Object from a custom select field in a query
- meta_query order by date present -> future then show null
- In a WordPress multisite configuration, how do I instruct WP_Query() to return posts from a sub-site?
- How to query for exact string in custom field?
- Multi line of $wpdb->query just run 1 time and end the loop right after
- Sort posts on custom field AND after that sort on date?
- Get last child of given page by ID
- How to query users by post count no less than 10
- display the children of the post using the current page as the main parent
- Paginated Author.php not using Author.php template
- A very strange problem with search query
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Custom Theme Building & Permalinks
- wp_query – show pages that have parent defined
- previous_posts_link not working in WordPress pagination
- Eliminate typical pages on search page, turn it into ajax search with “infinite” sized single page
- Display First posts without the default featured image
- paginate_links() with Custom Taxonomy
- Parsing External Table Arguments
- query_posts, oderby meta_value & print “future” posts
- Query posts by meta value and sort by another meta key
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Why does WP_Query not search for two ‘meta_query’ keys separated with OR?
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Custom WP_query in Jnews theme returns thousands of posts
- wp_query loop with compare operator simply not working, why?
- Query All Posts: Either Display Most Recent or One with Particular ACF Value Chosen
- Display only posts with thumbnails