Just inherited a client site that is a bit of a mess and am looking for some help.

All of the content is within the php page template, it is not directed to the WYSIWYG editor at all (which I would like it to be for client sake). The first half of the content is just text, while the secone half is a query. The content in the query is fine, obviously, but I would like the top halfe (the text) to be in the editor versus the page template. Both parts are within the same loop, so maybe there needs to be two loops on the page?

I have tried to do a custom field to call to the page instead, but nothing is working. What can I do here? I'll bold the areas in question. I know it's elementary, but help!

Here is the code:

Template Name: About Page

$title = get_post_meta( get_the_ID(), '_msk_subtitle', true );

if ( ! trim( $title ) ) {
    $title = get_the_title();

$thumb_id        = get_post_thumbnail_id();
$thumb_url_array = wp_get_attachment_image_src( $thumb_id, 'full' );
$thumb_url       = $thumb_url_array[0];

get_header(); ?>

    <div id="primary" class="content-area">
        <main id="main" class="site-main" role="main">

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

                <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

                    <div class="page-header" <?php echo( $thumb_url ? 'style="background-image: url(' . $thumb_url . ');"' : "" ); ?>>
                        <h1 class="page-title"><?php echo $title; ?></h1>

                    <div class="indent">

                        <p>**I WANT THIS INFO TO BE IN THE WYSIWYG EDITOR**</p>


                    <!-- indent -->

                    <!-- entry-content -->

                    <!-- quote -->

                    <h2 class="our-team-title">**Our team**</h2>

                    <div class="team-grid">


                        $args = array(
                            'post_type'      => 'team_member',
                            'posts_per_page' => 99,
                            'orderby'        => 'menu_order',
                            'order'          => 'ASC',

                        $team_query = new WP_Query( $args );

                        $i = 0;
                        // The Loop
                        if ( $team_query->have_posts() ) {

                            while ( $team_query->have_posts() ) {

                                $i ++;

                                if ( $i == 1 || $i == 4 || $i == 7 ) {
                                    echo '<div class="team-row">';

                                $names      = explode( ' ', get_the_title() );
                                $first_name = $names[0];

                                if ( ! $first_name ) {
                                    $first_name = get_the_title();


                                <div class="team-member">
                                    <p class="team-image"><?php the_post_thumbnail(); ?></p>

                                    <h3 id="<?php echo $first_name; ?>"><?php the_title(); ?></h3>
                                    <?php the_content(); ?>


                                if ( $i == 3 || $i == 6 || $i == 9 ) {
                                    echo '</div> <!-- team-row -->';


                        } else {
                            // no posts found
                        /* Restore original Post Data */


                    </div> <!-- team-grid -->

                    <?php // the_content(); ?>

                </article><!-- #post-## -->

            <?php endwhile; // end of the loop. ?>

        </main><!-- #main -->
    </div><!-- #primary -->

<?php get_footer(); ?>
  • Could you please clarify your question? What is it that is not working? How do you want it to work, and how is it working now?
    – WebElaine
    Sep 25, 2017 at 20:32

1 Answer 1


You are in luck. WordPress core includes a function to retrieve the CMS editor content and place it where you'd like it in your template. In fact, it is already in place in your template, just commented out:

the_content() is what you are looking for, but it doesn't belong where it sits in the code you posted.

<?php // the_content(); ?> <-- delete this commented out PHP.

Keeping the template you have assigned to that page, simply replace your: <p>**I WANT THIS INFO TO BE IN THE WYSIWYG EDITOR**</p> placeholder with the WP function:

<?php the_content(); ?>

Whatever is added to the CMS editor for that page will be inserted into the template at that location.

  • THANK YOU! THANK YOU! THANK YOU! I had tried that earlier but didn't realize that the query content still pulled in at the bottom half of the page as the css was a bit junked up. I really appreciate your help. Sorry for all of the grammatical errors in the question - was in a meeting at the same time.
    – ingcol
    Sep 25, 2017 at 21:17
  • 1
    I'm the worst. Where do you accept the answer?
    – ingcol
    Oct 2, 2017 at 3:48
  • No worries - I'm sure you are not that bad. You should see a checkmark near the up/downvote arrows. More info: meta.stackexchange.com/a/23139
    – jdm2112
    Oct 3, 2017 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.