The function the_content()
prints the content with a p
tag itself. I mean, if you use
echo '<p class="our_p">' . the_content() . '</p>;
It actually outputs-
<p class="our_p"><p>lorem ipsum dolor sit amet...</p></p>
Use get_the_content()
instead. It will return the unfiltered content. Something link this-
echo '<p class="our_p">' . get_the_content() . '</p>;
Codex: https://codex.wordpress.org/Function_Reference/the_content
Related Posts:
- Are content.php and content-single.php the same?
- Responsive class to all the images in the content
- How to hide and content from auto-generated excerpts?
- the_content() in single-{post-type}.php problem
- Displaying recent post excerpts on static front page
- Force Balance Tags not working
- How to place HTML tags in content from the_content()?
- Custom Blocks as part of a theme
- Edit value of the_content() before showing
- Why tags are displayed bellow the content and not inside
- Post and page content not displaying in search results
- Single.php the_excerpt loads same as the_content not loading read more line
- pre_get_comments or the_content filter
- WordPress Load Only Page Text
- Stop WordPress from showing images on non post pages
- Getting post URL within custom content template
- Strip HTML tags on custom code from the_content
- Suppress the_content filter in a nested loop
- Confused on loading page content
- Return the_content() with custom div class for a subset of posts
- How important is it to enqueue a theme’s stylesheet?
- Can a theme be built in React?
- Why I can’t add a CSS style in this WordPress theme?
- Posts in multiple Categories different single.php
- Single Page WordPress Theme – Using page templates
- Confused about image sizing business in WordPress
- Add link option to featured image?
- Creating the modern ‘single page’ html5 css3 layout in wordpress
- esc_url not working within add_settings_field callback
- How to override BuddyPress 3.0 bp-nouveau theme files?
- Which theme foundry has clean coded themes, where code is poetry [closed]
- Responsive Images – Generating multiple images from Theme Customizer control upload?
- How can a Theme Contain no Header File or Footer File?
- Same footer on all multisites blogs
- Adding “latest from the blog” to the homepage
- New template, where to place CSS?
- WordPress not registering Theme Customization Section
- How to get comment meta values by post ID
- For best DB performance should I serialize all theme options together or by type?
- Find the Children of a Page then Echo it as a Bulleted List of Links (menu)
- Non-Blog Website without Search: are comments.php and search.php in theme still required?
- Custom Widget options in theme
- Include Parent functions.php in Child Theme functions.php
- Redirect to specified page when insufficient permissions?
- Reasons why all thumbnail sizes aren’t working
- Jetpack Comments with fall-back
- Update a custom theme with Subversion?
- Should I use add_filter for functions in function.php of the theme?
- Multiple TinyMCE Editors in one Admin Page
- wp_script_add_data doesn’t seem to work
- How to override checkbox styles if these inputs have a unique id [closed]
- What are the minimum role/permissions for freelance developer?
- Where am I doing wrong in my theme menu?
- Calculate data and passing to Theme
- Multisite theme path rewrite using .htaccess
- Retrieve localised value
- How to disable wordpress from overload my stylesheet styles with customizer styles
- Get the amount of posts on a given page
- How do I use a color from theme options?
- Second menu has the first menu ID
- How to include a file only on dashboard widgets page?
- WP_Query $gallerypage->the_post() giving Undefined offset: 0
- How do I conditionally defer scripts based on the page name?
- How to place POST TITLE any location inside the posts page
- Do I need to re-import Susy to work with it in a child theme? [closed]
- Valid SQL query not returning results
- Change Image Sizes for Mobile Theme
- Recommended sidebar / content widths
- Trouble in creating a custom template on twentyeleven theme
- language support in a custom urdu theme
- Is there a list of default generated Gutenberg block CSS? Unable to align video blocks
- In wordpress customizer div still showing even if I hid it with javascript
- Programatically Created Menu not Editable in Dashboard
- Embedding CodePen Calorie Script – jquery error
- How to make updatable custom WordPress theme?
- How can I access variables from theme in child theme? [closed]
- Is it possible to echo a woocommerce prouct attribute discription?
- change background image on scroll
- Duplicate child theme incl. design changes
- Why .widget-area is outside of .site-content in Underscores starter theme?
- Using wp_add_inline_style Inside a Template File
- How can I use a different template file for the blog index’s paginated pages?
- How to customize the colors within a stylesheet using a WordPress setting
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- On wordpress, how do i require specific dimensions from user uploads only
- how to create export / import theme options in wordpress without plugin
- Modify comments_popup_link output
- Create image with imagepng() (fails at header)
- Can you create a custom page with content in the center already defined?
- Dynamic meta description
- RSS feed url showing page not found. How to solve it?
- Enable WP to accept standard jQuery code embeding between the tags [duplicate]
- Retina ready for uploaded images which are cropped
- Search Results not displaying for multiple word search
- Allow users to edit home page from WordPress (home.php problems)
- WordPress does not know the parametrs i sent to admin post
- Display Page featured Image as well as Posts featured Image
- Creating completely new WordPress site from old WP contents
- Custom Single Page Portfolio Theme [closed]
- What is the point of using archive.php instead of index.php?