I need to stress that I think this is going to be very unstable and you may not always get the results you want, but in simple cases this should work.
$content = apply_filters('the_content', get_the_content());
$content = explode("</p>", $content, 2);
// var_dump($content); // debug
echo $content[0].'</p>';
echo '<div>Extra Content</div>';
if (!empty($content[1])) {
echo $content[1];
}
Related Posts:
- the_post_thumbnail() based on the Post ID
- How to center all text body in single.php at once?
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- Mega Menu Walker
- Displaying Logged-In User Name in WordPress Menu
- Autoloading in Child Theme
- How to add a class to the attachment images
- Set media upload attachment link to none and hide it in WP v3.5
- One button to change all settings in theme customizer?
- Add custom image sizes to media uploader
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- How can I default to all WordPress roles when parameter is not included in shortcode?
- How do I list the_tags() into HTML data-attribute
- WordPress if (is_page) translation on certain page
- Check if term object is in array
- Highlight Current Tag in wp_tag_cloud
- Getting rid of role=”navigation” in the Home Page Pagination
- How to use return in my custom function instead of echo
- How to speed up a wordpress function with multiple loops?
- Trigger popup in a php if/else statement
- Setting a cookie upon specific URL visit
- get post based on category chosen in drop down – The ajax method
- how to make separate field in wordpress user_data_
- Add a class to the anchor tag on HTML5 gallery
- Conditional Header in wordpress
- Menu — How to add “current-menu-grand-ancestor” css class
- Set the background to a default image if there isn’t a specified “featured image”
- Calling directories to load in wordpress
- WordPress Access allowed to fewer pages till user logs in
- Use DOMDocument with ob_start breaks my HTML code
- Display a specific category of products in shop page and disable code for specific actions
- Removing “wpautop” (auto tags) only on certain pages?
- different id for same element visual composer [closed]
- Tax query in pre_get_posts not working
- trigger html cleanup for all posts
- Validation algorithm in checkout field
- Catchable fatal error: Object of class stdClass could not be converted to string after WP 4.7
- Add class to group inner container
- Use .php file as page instead of wordpress page & template file?
- Illegal string offset in PHP function
- Find hours between post_date and post_date_gmt
- How to remove ?p= from wordpress short links
- Displaying text if post was within 5 hours
- Convert the_permalink() function output into string
- Adding a tag_ID column into Categories inside the admin dashboard?
- WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank
- How to make function appear in sentence?
- How to define a variable already defined in a plugin function?
- woocommerce specific quantities for product
- My website is not showing Footer section
- get_current_site() is undefined
- Custom query vars filters problem with pagination
- Automatically Add Page Links to Nav Menu
- blank white page when post/update/change option etc
- Function sanitize_title() does not appear to be working
- Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS
- Must filter functions receive all arguments passed to them?
- How to Display a List of Child Pages For a Parent Page in WordPress
- writing an unique php function to be used on my website
- Displaying Slider in Front Page (home) using Customizr Theme
- How to add PHP pagination to wordpress
- Taxonomy term description with style, only if the description exists?
- Restrict post to current user in postmeta
- How to change the author box selection on a post to a custom taxonomy
- Output product category link from WP_Query
- Adding onload to body for certain pages
- Delete images from media library when user deletes an image from ACF Gallery
- How to send a php var to jQuery Ajax call with two different file
- Change wordpress’ database data using ajax – how to get current user id?
- copy fields value to another field
- not outputting medium size image URL
- posts_per_page displays only 2 posts instead of 4 posts
- Get parent category name when only child category is applied to a product
- Best way to use variables in multiple functions?
- Can an AJAX callback function access a PHP variable which was defined during initial page load?
- Adding product permalink on admin order page throwing error
- Before & After Content – After Content directly below Before Content when using require_once
- Cannot fetch posts with certain ‘product_cat’. WP_Query is empty
- Detect what link user clicks and Redirect to a specific page for logged in users only
- Offset with ajax load more posts duplicates
- How to call WordPress PHP file using external js file
- How fix error in the WordPress loop?
- use system script advertising in wordpress multisite
- Use WP_Query Data In Cookie
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- Insert wordpress tags below posts via functions.php
- Help with my first Metabox helper class
- syntax error unexpected ‘}’ at 364 line
- get_post_meta no longer working
- Highlight posts currently being edited on multiple editor site?
- ISOTOPE – Missing/Invalid Arguement Get Terms
- Showing all post from all post type in admin backstage
- Pagination not displaying
- Setting WooCommerce currency programmatically
- Masking external links with internal link for member-only
- Shortcode to include PHP file, pass various parameters to include?
- Why can’t I include echo inside a variable? [closed]
- Assign new post author IF another user in custom field on post transition
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week
- how to create twitter card without plugin in wordpress website?