0
votes

Is there a way to combine content from a wordpress page's main textarea with the content in its custom template?

In this case I have a custom template that displays all posts from a single category, but I would also like to have a section that displays what is written in the wordpress admin Page area.

This is how I have the custom template set up to display relevant posts:

<?php query_posts('category_name=baby-coupons'); ?>

    <?php /* Start the Loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>                  

    <h2><a href="<?php the_permalink() ;?>"><?php the_title() ;?></a> <span class="post-date">- <?php the_time('F j, Y'); ?></span></h2>

    <div class="row">

        <div class="one-third">

            <?php 
            if ( has_post_thumbnail() ) { 
              the_post_thumbnail();
            } 
            ?>

        </div>

        <div class="two-third last">

            <?php the_excerpt() ;?>

        </div> 

    </div><!--/row-->    

    <hr>    

    <?php endwhile; ?>

Above this I would like to have the wordpress pages admin area content display, what a user would normally write into the textarea to display on the page, is this possible?

1

1 Answers

0
votes

This is what I've come up with:

<?php get_posts(); ?>

<?php while ( have_posts() ) : the_post(); ?>  
    <?php the_content() ;?>
<?php endwhile; ?>

<?php query_posts('category_name=baby-coupons'); ?>          

    <?php /* Start the Loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>                  

    <h2><a href="<?php the_permalink() ;?>"><?php the_title() ;?></a> <span class="post-date">- <?php the_time('F j, Y'); ?></span></h2>

    <div class="row">

        <div class="one-third">

            <?php 
            if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
              the_post_thumbnail();
            } 
            ?>

        </div>

        <div class="two-third last">

            <?php the_excerpt() ;?>

        </div> 

    </div><!--/row-->    

    <hr>    

    <?php endwhile; ?>

Is this acceptable? It's working but I'm not sure how classy it is!