I'm trying to create a "Start here" page on my blog. I use a template for that, but the content for it is created using the "add new page" wizard in WordPress.
I know how I can display the most discussed posts (with most comments), but PHP doesn't work in pages. Of course I can just paste the code into the page template instead, but look at my template:
<?php /* Template Name: Test Layout */ ?> <?php get_header(); ?> <div id="start-here-wrapper"> <ul> <?php $pc = new WP_Query( 'orderby=comment_count&ignore_sticky_posts=1&posts_per_page=6' ); while ( $pc->have_posts() ) : $pc->the_post(); ?> <li> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> </li> <?php endwhile; ?> </ul> <?php the_content(); ?> </div> <?php get_footer(); ?>
I use "the content" so that everything I write via the "page wizard" will be in there. I don't want to copy and paste everything into the template itself for various reasons, so I need to find a way to make this work with the code above.
If I call the popular posts below "the content", it works without any problem. If I call it before it (like in the code above), the actual content of my page won't show up and instead the last blog post in the list of popular posts will be displayed.