You don’t really have a Loop.
<?php get_header(); ?>
<div class="content">
<div class="welcome_area">
<div class="welcome_area_title"><?php the_title('');?></div>
<div class="welcome_area_text"><?php
if (have_posts()) {
while (have_posts()) {
the_post();
the_content();
}
} ?>
What is happening is:
- You use
have_posts()
to check that you have post content. You can use anelse
clause to provide default content if you want. - You loop through that content using
while(have_posts())
- You run
the_post()
to setup the$post
variable and also to increment the loop counter. Try that withoutthe_post()
an you get an infinite loop. This is the most critical part that was missing from your code. - Now that
the_post()
has run, your post template tags should work as expected.
I didn’t edit your code too radically but I’d bring that the_title
into the Loop as well, even if it seems to be working. It really should be inside the Loop and it does not always work as expected outside of it.
Reference
https://codex.wordpress.org/Class_Reference/WP_Query#Methods