It appears that wpautop()
, which adds the <p>
tags, doesn’t have any way to filter the <p>
tags it adds.
If you’re trying to replace all the <p>
tags in the content with your <p class="{...}">
, though, you should be able to use the the_content
filter:
add_filter( 'the_content', 'wpse412742_class_up_the_paragraphs' );
/**
* Adds classes to all the <p> tags in the content.
*
* @param string $content The post content.
* @return string The post content with the classes added to the <p> tags.
*/
function wpse412742_class_up_the_paragraphs( $content ) {
$content = str_replace(
'<p>',
'<p class="pwp-testmonials-slider__desc_depoimento text-center">',
$content
);
return $content;
}
Related Posts:
- How does printf( __( ) ); work?
- Return HTML Template Page with PHP Function
- Displaying Logged-In User Name in WordPress Menu
- Change the filename format of saved featured images
- Getting the comment number relative to all the post’s comments
- How do I add a php statement to a jQuery string
- Upload images and attachments from frontend form
- Config apple-app-site-association file with wordpress
- How to use the php if statement [closed]
- lazy load comments wordpress on click
- Use Filename for Alt and Title Tags
- Should I use wp_mail or PHP’s mail? [duplicate]
- Trying to use Ternary operators with WP Conditionals
- How can one utilize a variable as a callback function name for add_settings_field
- Generate an array of parent/child page IDs, based on parent page name
- Link to file in plugin directory from wordpress template?
- Using a switch statement in WordPress
- wp_handle_upload – The uploaded file could not be moved to wp-content/uploads/2012/09
- Pass PHP variable to JavaScript without inline JS
- Stumped on migration
- Where Does WordPress Make cURL Requests? How To Add cURL Option
- Using $_GET in Functions.php [closed]
- Adding nofollow to a PHP generated Nav
- How to show part of the_content?
- WordPress plugin/code to hide all things related of a user from the public
- Store multiple custom field as post meta per post(css, js, html, 2 link) [closed]
- Call a PHP Function with Multiple Parameters that is outside the AJAX Handler
- WordPress Gravatar filter is removing my custom attributes
- How to make my custom widget appear within WordPress widgets? Plugin development
- Function works when I don’t login to WordPress but when I login then it doesn’t work
- “imagejpeg” function is not working in wordpress
- edit search.php to include subdomain posts
- PHP code to use on next & previouspage links
- Copyright info change – Corporate Plus Theme PHP [closed]
- Inject class in body when particular page template is used
- Category title output before opening title tag
- unable to use ‘new WP_Query’ in AJAX call
- How to remove coupon dropdown feature
- Jquery window.send_to_editor function
- how to prevent wordpress admin from logging in via woocommerce my-account page
- Add html link in functions.php files of the theme
- Automatic excerpt is not shown with the_excerpt() command
- Get post categories
- Handling PHP/HTML inside the output of a shortcode function
- Output only links using wp_nav_menu()
- Update post meta – Custom field does not match meta-key
- Need help removing […] after excerpt
- How to add Post Tags to a new element in header.php?
- How to replace URL protocol using PHP?
- How to make the WordPress Editor not accept HTML?
- Disable category RSS Feeds on WordPress blog with PHP
- WordPress Custom Add To Cart Button with AJAX
- Custom reduce stock code affecting date_modified – How to bypass?
- Publish button now showing content after saving
- User filter posts by year
- bp-custom.php is not working on a WordPress multisite environment. how to fix it?
- Pagination in single.php
- Why wp_remote_get() fetches certain web pages while it doesn’t work for my localhost?
- Trying to call dynamic content into a 3rd party shortcode
- Adding wp users ID into a link address from a DIVI modul
- Execute function only for specific user roles
- Limit Search to Product Pages only unless I’m on Blogpage or Blogposts
- WP query posts BUT show the most recent and one per author
- Block error message in foreach loop when looping through ACF field
- Include User ID in iFrame URL
- I have a background-image in css file but don’t show in site.how to fix this prblm. i sent screenshot. thx
- “Class Not Found” in HTML Form Target PHP File that contains the class
- shortcodes, custom php and their errors
- static page pagination not working
- Add a new view on the Woocommerce account page
- Should I use wp_cache in my plugin to make it faster?
- clicking on the_tags() generated tags to show all tagged posts page
- How to change the value of a variable using input field?
- Collect all events in one year
- Difference between “Walker_Nav_menu” and “walker”
- Remove node from multisites?
- Woocommerce variable products are being added to the card on the homepage (ajax)
- user update profile for custom code
- migrating wordpress, but getting some php parsing errors
- Display a single row from nested array of custom field data
- Why isn’t my custom Javascript showing up in my custom template?
- Where is the php file of single member profile view (BuddyPress)
- global $post inside plugin query messes up every new post page in wp-admin
- Reformat data within a nested array
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- How to resize an image server-side before upload?
- Need some help with tweaking a code for woocommerce [closed]
- Outputting a custom field in PHP
- Magento and WordPress URL integration [closed]
- Switch-Case and user_role
- unable to set uploaded file via frontend form as featured image
- Metadata on the WP_Post object
- How to customize posts in WordPress by using HTML and CSS?
- paginate_links() returns NULL instead of the pagination links, but pagination is actually happening
- is it possible to create cart functionality without woocommerce? [closed]
- 404 after removing “category” base in wordpress
- Is there a way to get wp_editor (tinymce) content?
- Displaying generated HTML within a WordPress site
- WordPress PHP8 Critical Error in class-wp-widget.php
- How to get the last date updated of postmeta?