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:
<?php
/*
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>
<div class="indent">
<p>**I WANT THIS INFO TO BE IN THE WYSIWYG EDITOR**</p>
</div>
<!-- indent -->
<!-- entry-content -->
<!-- quote -->
<h2 class="our-team-title">**Our team**</h2>
<div class="team-grid">
<?php
$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() ) {
$team_query->the_post();
$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(); ?>
</div>
<?php
if ( $i == 3 || $i == 6 || $i == 9 ) {
echo '</div> <!-- team-row -->';
}
}
} else {
// no posts found
}
/* Restore original Post Data */
wp_reset_postdata();
?>
</div> <!-- team-grid -->
<?php // the_content(); ?>
</article><!-- #post-## -->
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>