You could make your own excerpt function:
function wpse125086_custom_strip_tags_excerpt() {
global $post;
$p_obj = get_post($post->ID);
$p_exp = $p_obj->post_excerpt;
$p_exp = apply_filters('the_excerpt', $p_exp);
$un_p = array("<p>", "</p>");
$p_exp = str_replace($un_p, "", $p_exp);
echo $pcont;
}
But generally I’m thinking instead of transforming to get_posts()
it might be better to go with WP_Query
. In this case the standard filter you’re using should work just fine.
Edit:
If it’s about the opening/closing <p></p>
tags, you can just go with get_the_excerpt()
, because it doesn’t add those. you have to echo it to print the excerpt out.
echo get_the_excerpt();
Related Posts:
- Post Loop not Returning Permalink
- query_posts() vs get_posts() multiple loops [duplicate]
- Is it necessary to reset the query after using get_posts()?
- AJAX with loop filtering categories
- WP_Query vs get_posts
- How to return results of a get_posts() in explicitly defined order
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- Why is it necessary to call rewind_posts() when using the loop more than once? [duplicate]
- Retrieving 3 latest post from each of 5 different custom post types
- Multiple posts with one loop iteration
- Get posts that matches specific terms of multiple custom taxonomies
- Exclude filter on front page
- How to Loop within a Loop (Display Children and then Grandchildren)
- Exclude first 2 posts with meta_key from loop
- Is get_posts() more efficient than The Loop?
- Filtering The Loop For Single Page and Blog Page
- Sort Posts By Category?
- Custom search form to display users only
- Better way to display posts from specific categories, in a grid layout
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- How to get_posts where ‘menu_order’ is more than 0/zero?
- popular post weekly and monthly
- Display the_content on click jquery
- Query posts if meta key starts with
- 3 Posts in Loop, Show Stickies First
- How to return only one instance of each, from the entire loop
- Inserting custom data to the_post() during loop
- What is the maximum number of posts a WordPress loop can work with?
- Why only one post (and no pagination) on this variation of the loop?
- Query reset problem or flawed code to enable custom post type query
- Query last updated posts (posts updated in the last 24 hours)
- Displaying terms based on loop posts?
- Sort posts by most recently modified
- Combining action and filter?
- Filter the loop by categories using checkbox form
- A smarter way to display multiple loops inside a page template
- Duplicated posts on category page
- Make blog page show 10 on first page, 9 on every other page
- Filter the_posts doesn’t work on search page
- Get all posts including sticky ones with get_posts(),setup_postdata(), and foreach loop?
- How to display posts by vote count and if no value continue with latest posts with no votes?
- Show all posts using the template page and the loop?
- Showing sticky posts with get_posts()
- How do I paginate a get_posts() request inside another page loop (Paginating childpages)
- How to remove a plugin filter’s priority on specific loops (custom queries)?
- Both a page loop and posts loop on the same page
- How to get The Loop working with $wpdb->get_results()
- Exclude first post (sticky or not) from the loop using query_posts()
- How to order by multiple fields using standard query_posts?
- Multiple get_posts() queries on one page
- Pagination not working in category listing [duplicate]
- How can I improve the performance of this query_posts loop?
- 404 Template customization | Want 10 recent Post on the 404.php error page apart from the error Notice
- Output meta into arrays
- Trying to get property of non-object in shortocde
- Adding div after every two post on main loop! Why will first post not get counted?
- Get post offset/posts page offset in single post page (outside the loop)
- get_posts output always same post
- How can I access specific posts brought back by query_posts?
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Separate First Post Loop
- Make a loop to return x number of posts, but only if they have content or excerpt
- Query posts only with actual text content (not including shortcode or images)
- Filter existing hook using parameter and foreach loop
- query_posts clarification needed
- get_posts() forcing ignore sticky posts on main loop
- Exclude current post ID from loop in sidepbar.php
- loop inside a loop : search for posts in the same category
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- Why does my WP_Query pagination on a custom page.php only loads the homepage?
- Loop order issue with Ajax filter
- Get a Post Loop based on Logged in User information into a Shortcode
- php loop error for count posts in category
- Add Search and Filter functionality to custom loop
- how to add 4 post in one carousel slide
- Reorder posts in a loop: have the posts by one particular author below the others
- How to filter get previous post function by meta value DESC and post date DESC?
- WordPress redundant posts based on meta field
- Create a hierarchical loop at predefined markup requirements
- Ordering Posts by parent category, name ascending
- numberposts not responding to wp_reset_postdata()
- Remove posts_orderby filter then add it back in
- Buddypress Group Activity Loop Filter activity type [closed]
- Query counting excluded category on paged loop
- query_posts ignores the argument
- The Loop isn’t working
- Need some help with “the_widget()” function
- Is there a way to target only images within the loop?
- Twitter bootstrap carousel multiple items in carousel
- show posts from one category with comments only
- Show last post from multiple categories using wp_list_categories
- Least Number of Loops to Create Custom Homepage?
- Help with add_filter(‘the_content’, ‘some_function’) and multiple matches
- How do I correctly query posts from a post ID?
- Applying a filter to multiple loops for days ago
- Question about custom plugin
- How to do query_posts on tags pages
- show custom post’s post in two different divs [duplicate]
- Limitless amount of posts in custom archive page