If you are trying to do it for the current page you are on you can just use this:
global $post;
$content = $post->post_content;`
This will get the content for the current post instead of having to set the ID specifically.
Related Posts:
- Split Content and Gallery
- How can i display the content in plaintext
- remove tags from the_content
- the_content and wp_link_pages
- Add Incrementing ID to each paragraph in the_content
- get_the_content not working in loop?
- the_excerpt(), get_the_excerpt() and the_content() all killing “the Loop”
- Content/Excerpt length control for a specific loop?
- Combining the_excerpt with the_content
- the_content() seems to block my ACF-code
- Removing the_content() from the page
- How to make post content from each post display within the same div
- Loop after page content
- Only display videos and images in the_content() within loop
- Styling text and images in the_content()
- Cannot retieve the_content() and the_author() – both returning empty strings
- How is WordPress changing the content markup?
- Insert content above an embedded video inside Wordress’ php the_content
- Split Content and Gallery
- the_content() keeps repeating itself
- Echo Most Recent Sticky Post in Loop?
- Making a specific page wordpress compatable that is not index
- how to use custom loop in the_content filter
- change the_content images for different sizes (Desktop, tablet, mobile)?
- Have multiple loops on a page appear after/between page content
- In Loop Output Place Custom Field Content In Between Paragraphs
- Help with add_filter(‘the_content’, ‘some_function’) and multiple matches
- Single Loop With Dual Content Area
- How to add custom HTML markup and classes to the_content()?
- the_content() “crashes” for single pages
- Hide old posts each year
- How do I get the attributes of a short code from a post?
- WordPress category & taxonomy loop with pagination
- Changing behavior of the loop twice in one page
- Show scheduled posts in archive page
- Transient not working for custom loops
- Custom Loop, Match Category with Page
- Display page of custom posts?
- include(locate_template) messing up the loop
- If No Search Results, Show Posts from Alternate Search Query
- Loop – how to get previous/next post for first/last post?
- How to add “time” data this?
- Loop through all media library images and return those where caption contains the text carousel
- Custom search form to display users only
- Displaying the last page of posts
- How to get_posts where ‘menu_order’ is more than 0/zero?
- WordPress Redirects on Install
- How to load all pages into one page with their templates
- How to return only one instance of each, from the entire loop
- Combining action and filter?
- Shortcode with a foreach and arguments
- Calling & display certain product category loop and pagination on the homepage
- Detect if current page is front page within custom query
- Blog’s post count cause irratic behavior
- Sanitize Custom Field Value in Meta Query
- Default ‘post’ post type archive slug?
- show random image in loop if image is not set
- Get Page content to displayin Bootstrap Modal
- Pagination – works on local but not live dev!
- need help looping add_action in wp
- Does WordPress Loop have a function like Shopify’s cycle?
- Combine the results of two loops [closed]
- How to show more random posts if Tag has less than 3 posts
- How to display pending posts on the homepage only for editors
- How can I improve the performance of this query_posts loop?
- Add leading zero to current post display [closed]
- Output meta into arrays
- Moving wordpress to different url/server creates redirect loop
- Pulling in featured image into default recent posts widget
- Random post link generator messes up the loop
- Modify loop output for a specific list of categories
- Print the whole page?
- Pagination for two loops
- Loop info in jquery Tabs – loop into a variable?
- Thumbnail Image Rounded Corners w CSS (or any other good method)
- Several loops in sidebar issues
- Adding $args to wp_schedule_event() causes hook to add infinitely to WP Cron
- $post is undefined in wordpress loop [ajax]
- Loop only shows first two posts
- Why is my archive page looping through all but one post?
- the loop printing post in one grid
- Check value of post meta within IF statement
- My WordPress installation doesn’t load correct template
- Work arounds for conditional checks inside the loop in search.php?
- adding tax_query to $query_string
- Get Sticky User in user loop based on user role
- Popular posts with Varnish ESI
- Querying posts from only one category and exluding the latest post
- Remove posts_orderby filter then add it back in
- WP update_post_meta link loop
- query_posts ignores the argument
- Need some help with “the_widget()” function
- Conditional Check in The Loop’s Parameters
- show posts from one category with comments only
- Exclude Authors based off date of last post
- Loop from another WP site onto mine
- Having issue with WordPress loop
- Wrap every 2 divs in row – for each loop [closed]
- How to add class to the last image of the last post in a loop
- Why did my most recent article fall behind an older one on my site?