I have read this webpage about how the loop works in wordpress
How does wordpress know if it is displaying a single page or single post or multiple posts. Does the wordpress interface set something behind the scenes?
If it is a single page I presume the content i add in the wordpress text editor is stored in a database and retrieved by this call
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h1><?php the_title() ;?></h1>
<?php the_content(); ?> <========HERE
<?php endwhile; else: ?>
<p>Sorry, this page does not exist</p>
<?php endif; ?>
Lets say i was using one template for all of my website pages, and these pages were having their main content included through the template part above (which i believe gets copy from the database ), how would i have another page in the website that had additional content in the main section other than text , would i have to add the code to the template part above (probably in some if statement which checked the page?). Or would i do this with widgets somehow. In the default wordpress installation it looks like i can only drag widgets into something called primary. I was assuming you would be able to drag them into the main 'loop content' somehow
Thanks for your help.
If i wanted to add something else (other than simple text) to a web page which used the above template part for the main content of the webpage, how would i do it? Would i have to make a specific template just for that page which basically adds some extra code to that show above to generate the additional content