I am trying to create a page template that will list posts of a given category/multiple categories in alpha order by post title, but every time I create a custom template and assign it to my page, it seems to incorrectly parse out
What I have in my theme:
Code:
<?php get_header(); ?> <div id="main" class="row"> <div id="content" class="col8"> <div id="post-<?php the_ID(); ?>" <?php post_class('cf'); ?>> <h1> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a> <?php bfa_comments_number(); ?> </h1> <div class="post-bodycopy cf"> <?php the_content(); ?> <?php // The Query query_posts( array( 'category_name' => 'food-drink', 'posts_per_page' => -1 ) ); ?> <?php // The Loop while ( have_posts() ) : the_post(); echo '<h1>'; the_title(); echo '</h1>'; the_excerpt(); the_date(); echo 'Categories: '; the_category(', '); echo '</p>'; endwhile; ?> <?php // Reset Query wp_reset_query(); ?> <?php wp_link_pages( array( 'before' => __( '<p class="post-pagination">Pages:', 'montezuma' ), 'after' => '</p>' ) ); ?> </div> <?php edit_post_link( __( 'Edit', 'montezuma' ) ); ?> </div> <?php comments_template( '', true ); ?> </div> <div id="widgetarea-one" class="col4"> <?php dynamic_sidebar( 'Widget Area ONE' ); ?> </div> </div> <?php get_footer(); ?>
Code:
Content goes here. 'food-drink', 'posts_per_page' => -1 ) ); ?> '; the_title(); echo ''; the_excerpt(); the_date(); echo 'Categories: '; the_category(', '); echo ' '; endwhile; ?>
Am I doing something wrong? Is the Montezuma theme stripping out certain PHP code and rendering the loop inert? Do I need to change a setting or adjust the code somewhere?
I am a complete newbie to PHP so it could be something very obvious and I just don't have sophisticated enough understanding to recognize it, but if someone can point out my error and/or direct me to where I can learn more, that would be immensely helpful