I’ve found the solution. According to https://codex.wordpress.org/Function_Reference/the_content#Overriding_Archive.2FSingle_Page_Behavior, one must add
global $more;
$more = 0;
before the call to the_content()
. So now my inner loop reads:
<?php
$recent_posts_query = new WP_Query(array('post_type' => 'post', 'posts_per_page' => 5));
while ($recent_posts_query->have_posts())
{
$recent_posts_query->the_post();
?>
<div class="post">
<h3><?php echo the_title(); ?></h3>
<p>by <?php the_author(); ?></p>
<?php
global $more;
$more = 0;
the_content();
?>
</div>
<?php
}
?>
Related Posts:
- When to use is_home() vs is_front_page()?
- Change loop order via form or link (jquery, not URL)
- Set front page as static page [closed]
- the_content() in single-{post-type}.php problem
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Custom Blocks as part of a theme
- Suppress the_content filter in a nested loop
- Not Found when using activity stream as front page with BuddyPress
- Customize how a WordPress theme looks like in the Theme Selector
- WooCommerce: multiple input field for multiple product variations
- Customizer – loading settings/controls/sections/panels based on a id/page id
- The Content is not Wraping in tag
- Integrate WooCommerce theme with a WordPress theme [closed]
- how to get the post attachement image in full size?
- Widget Option is Missing
- How do you use WordPress for a website that’s not in a blog format?
- Default Text not showing from customizer
- Edit value of the_content() before showing
- Child Theme header1.php file not overwriting parent theme’s header1.php file
- How to set wp_options in functions.php for removeing the Default Front Page
- Get the amount of posts on a given page
- How to have content scroll over background
- WordPress Template Part in iFrame
- How to list articles by year based on url?
- Replace site title with logo when logo is uploaded in customizer using
- How to transfer one domain to another domain without losing theme options (customizer)?
- is_home and is_frontpage always true
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Change image size depending on page
- Why tags are displayed bellow the content and not inside
- Is there a WordPress boolean for “theme_customizer_active()”?
- How can I prevent posts with no title showing up in my query?
- How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?
- How to make theme configurable
- Extending Twenty Eleven Theme
- Theme Development -> Specific Homepage
- Post and page content not displaying in search results
- How to clean up the theme for production?
- Previous and Next links not populating, have I missed something?
- Templates without a loop, best practice?
- What is the need for the static front page [closed]
- searchform.php doesn’t work properly
- CSS added through customizer neglects the need of a child theme?
- What is the best way to build home pages with a lot of sections for distributable themes [closed]
- Twenty Seventeen Pages Loop
- Customizer: get_preview_url() inside customize_save_after hook
- Custom Post type content within a slider
- How to add custom meta box when you have a custom page template file
- add shortcode support in customizer
- Clearing dummy data before launch
- 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
- How to call a widget in a loop at a specific iteration value?
- Right procedure when you develop a WP Website for a client
- How does the loop know which post to view?
- Woocommerce Product attribute not imported with wordpress Importer [closed]
- New to WordPress – Read the Codex, Other Docs; Still Confused
- Create theme for mobile phones and tablets only?
- How to add custom page elements to the WYSIWYG editor?
- Using the media library for theme customization
- Confused by the behaviour of “front page” / “home” templates
- Retrieve WordPress’ the_content() with jQuery
- Exclude subcategory from wp_query
- Style first 3 posts differently with WP_Query [duplicate]
- Alternatives to handle customizer settings
- WP_Query not getting all posts, just tagged posts
- Update Specific Key Value in Complex `wp_options` object
- Can’t change theme name
- Remove/Hide a Widget on a Custom Template
- How to remove/replace current page template?
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- Pagination and multiple loops
- Stop WordPress from showing images on non post pages
- static front page ONLY for certain themes?
- My contact form – I’ve changed the source code but the changes are not being applied
- is_front_page use in sidebar.php
- How to custom category template based on category?
- How can I sort my loop based on meta data, using a form?
- How to use multiple check-box values to work in a function and insert values in database
- 1 post per category on homepage and counting those posts
- List categories of a post hierarchically?
- Exclude parent categories from the_category() within the loop
- get_the_terms() returning wrong results inside of loop
- Show only pages you are author of
- Add class every 4 post like , class_1, class_2, class_3, class_4 and class_1, class_2, class_3, class_4
- How do I make my terms for each product display via foreach loop? (woocommerce)
- WordPress Insert ads after every 5th post
- White screen of death on index.php page 3 and above?
- Getting post URL within custom content template
- WordPress theme files Organization
- Infinite loop when nesting have_posts()
- Local variable name in setup_postdata()
- Highly stylized pages
- Loop is breaking my theme. How can I fix?
- What is difference between add_theme_support and Theme Customization API?
- my ajax wont sent the data, please correct my code
- Is hand coding required at all?
- Text View (Code View) in WordPress Customizer TinyMCE Editor
- how to edit woocommerce checkout page