Problems with the_content() template tag

[ad_1]

I have the following layout I want to achieve:

<div class="container">

  <h1>HEADING</h1>
  <p>PARAGRAPH 1</p>

  (Custom widget area with three Bootstrap cards side-by-side...for the sake of space, I'm not including the code)

  <p>PARAGRAPH 2</p>

</div>

Ideally, I would like to hard-code the div and the h1 into the page.php template file, call a custom widget area in page.php (utilizing dynamic_sidebar()), and use the_content() in page.php to display paragraph 1 and 2 from the content entered in the WordPress Dashboard.

Here is where I run into a problem. In page.php, I would have the following code (slightly simplified, but this is the gist of it):

<div class="container">

<h1>HEADING</h1>
																									         																										
<?php the_content(); ?>

<?php dynamic_sidebar( 'card_widget_area' ); ?>	
	
</div>

I want paragraph 1 to be before the sidebar and paragraph 2 to be after the sidebar, yet, when I utilize the_content(), I get both paragraphs before the sidebar. Similarly, if I were to call the_content() after the sidebar, both paragraphs would display instead of only the second paragraph as desired. Is there a way to display only one of the paragraphs at a time using the_content() template tag? And can you use the_content() template tag more than once in a single template file?

Perhaps I am missing something or making things far more confusing than they need to be. Any help would be greatly appreciated!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer