Newsletter Post is taking the place of my home page content.
-
My home page has a left sidebar, maincontent, right sidebar. The left sidebar contains navigation and a link to the most recent newsletter post. The problem is, the maincontent (middle) section is displaying the most recent newsletter in full, rather than the content as entered into the text area in the dashboard for the home page. I used to be able to see the correct text for the home page before I made changes to the left sidebar to display the title as a link for most recent newsletter. I assume the “content” is controlled through the page.php file, but I have played with it and can not find the solution.
Here’s my code for the left sidebar (sidebar3.php):
<div id="sidebar3"> <div id="nav"> <ul> <?php wp_list_pages("title_li=&exclude=12,16,23,339"); ?> </ul> </div> <?php if ( is_single() ): ?> <h2>Past Newsletters</h2> <?php wp_get_archives('type=postbypost'); ?> <?php elseif ( is_page('home') ): ?> <h2>Latest Newsletter</h2> <?php query_posts('showposts=1'); ?> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ): the_post(); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <a href="<?php the_permalink() ?>"><?php the_title();?></a> </div> <?php endwhile; ?> <?php endif; ?> <?php elseif ( is_page('membership') ): ?> <h2>Membership Form</h2> <a href='https://www.mywebsite.com/wpcaluwild/?page_id=16'> Please take a minute to join us by filling out our membership form.</a> <?php endif; ?> </div>
Here’s the code for page.php:
<?php get_header(); ?> <?php include ('sidebar3.php'); ?> <?php include ('sidebar2.php'); ?> <div id="maincontent"> <?php the_content(); ?> <?php wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> </div> <?php get_footer(); ?>
And finally here’s the code for single.php:
<?php get_header();?> <?php include ('sidebar3.php'); ?> <?php include ('sidebar2.php'); ?> <div id="maincontent"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <?php the_content('<p>Read the rest of this page »</p>'); ?> <?php wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> <?php endwhile; endif; ?> </div> <?php get_footer();?>
Any help would be greatly appreciated.
Michael
- The topic ‘Newsletter Post is taking the place of my home page content.’ is closed to new replies.