the_excerpt()
function bascially echo(es) the get_the_excerpt()
function output, which in turns wraps the $post->post_excerpt
value in html <p>
tags.
So you can either strip the html markup,
<p class="myclass"><?= wp_strip_all_tags( get_the_excerpt(), true ) ?></p>
or, if you have access to the $post
object simply,
<p class="myclass"><?= $post->post_excerpt ?></p>
Related Posts:
- Twenty Eleven home page show only excerpt
- How to call the_excerpt() with tags or the_content() as an excerpt?
- How to programmatically bring back “excerpts” field in post editor in WP 3.1+
- How to hide and content from auto-generated excerpts?
- the_excerpt() not showing manual excerpt for Pages
- Bold letters inside excerpt [closed]
- How to move the the_excerpt’s read more link to another div
- buddypress: how do i make the group description excerpt shorter?
- the_excerpt(); tag not working
- Disabling automatic teasers
- How to make the excerpt_more filter apply to the actual post excerpt?
- How to obtain a reference to the_excerpt() from custom loop
- Exclude read more in the_excerpt [closed]
- Custom get_the_excerpt() only works on first post
- excerpt() shows different result between remote and localhost(development environment)
- Get Post’s Excerpt Without the Wrapping tags and the Read More link
- Single.php the_excerpt loads same as the_content not loading read more line
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- matisse theme show excerpts not whole content
- restrain filter on get_the_excerpt to queried item in stead of current post
- How to make force_balance_tags balance comment tag
- Filter URL and shortcodes from the_excerpt
- WordPress API Menu/Submenu Order
- What WP folder can I use to write files to?
- Form Submitting Error with get_template_part()
- Get 10 posts from a WP_Query. If less than 10, get the remainder from elsewhere
- Can’t get staging site to display same way as live site. Completely stumped
- Display a different theme for not logged-in users
- how to test a theme upgrade
- Best practice (forward compatibility) for theme options
- How to set path with WP_Filesystem and ftp base / chroot
- How to add paging to query
- what’s meaning of it when submit a theme?
- How to Modify a Widgets UL and/or LI Classes
- How to remove menus section from WordPress theme customizer
- Returning Variables back into a template
- Allow users to add custom functions to wordpress theme
- How to add custom template tag in wordpress theme?
- Doubled titles when using All in One SEO with custom template
- What page should I use for a contact form?
- Get attachments by user
- Appending a value to metabox before and after saving
- Modify the Additional CSS section (adding a disclaimer)
- I made a my own theme to WordPress and Admin Menu missing from frontend
- What program can I use to preview my wordpress site?
- I want edit_post_link() to open in a new window/tab (target=”_blank”)
- How to remove a file included in parent theme with locate_template() via child theme?
- Can’t override template file in child theme
- Simple way to get two language WP site
- How can i initialize a widgetized sidebar (with widgets)
- How do you force a sidebar widget to have a container div around all child widgets?
- Add widgets to available widgets section without changing the theme?
- jQuery not available to other scripts
- Override template file i subfolders
- Does the switch_theme action run when you’re upgrading a theme?
- How to obtain the html stripped version of $category->description?
- StoreFront product pages: Turn the Short Description section into a kindred tab section [closed]
- How to jump to newly posted comment anchor after submit?
- Best way to develop a new theme on a live site, with new content? [closed]
- Tag Page Not Listing All Posts With Tag
- Can I use WooCommerce in a headless CMS setup?
- How to transfer one domain to another domain without losing theme options (customizer)?
- Do I need to include a textdomain if my theme doesn’t support translation?
- Pagination not working on page template
- How can I prevent posts with no title showing up in my query?
- get_search_query() not working with search queries with ampersand in it
- Where to put custom page templates in theme?
- If user is logged in and has a role echo statement
- Let user to add input fields on theme option page
- .current_page_ancestor broken in Twenty Eleven
- MapPress Easy Google Map in Jquery Tabs Problem
- Homepage slider not using correct images
- WordPress Show Single Post on Home Page with previous/ Next Button
- How to change listing type permlink?
- WordPress theme header.php should I add title meta?
- Problems with cart and pages on _s theme
- Custom post type query with pagination doesn’t work
- Fatal error: Class WP_Customize_Image_Control not found
- How do I remove header/page-title image in farvis theme? [closed]
- Which theme PHP file should be edited in order to change Posts appearance
- How to link post image to post link?
- How to hide blog by id wordpress multisite listing
- Get chronological page order
- Query wp_postmeta into an array based on post_id
- How to override wordpress native options with theme options
- Problem with multiple menus in theme
- How to create multiple sidebar areas with a forloop and register_sidebars?
- How to convert that page to a wordpress template? [closed]
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- Saving Permalinks Results in 403 MAMP (Windows)
- Add rel to all images in a post
- WordPress theme Modifications not showing up on live server
- Which function(s) to build a paged HTML table
- white spaces on the all sides [closed]
- How to make a multilingual wordpress site to be translated one-to-one without much effort and without using translate?
- Is there a way to have WordPress autodetect page templates in the page-templates directory and any sub-folders?
- Theme template file for a specific custom taxonomy
- How do I work with responsive images in WordPress? (img srcset/sizes)
- How can I use pre declared blocks in a php file?
- jQuery Snippet Not Working on WordPress Site [closed]