OK, seriously people, I need help.
I know just enough PHP to get into trouble. My new commercial blog concept has a "news" page and a "product reviews" page, both based on the Thematic Blog page filtered by post category: "news" and "reviews" respectively.
I created new News Page and Reviews Page templates like so:
/**
Template Name: News Page
*
* This template allows you to display the latest posts marked "news".
*
*/
...
?>
The reviews page is coded similarly. The first problem I found is that when I created these new template pages, naming them template-page-newspage.php and template-page-newspage.php, the new templates did not show up in the drop-down list of templates in the "Edit Page" page.
Why are the new page templates not available?
Next, on each of the new template pages I replaced the standard thematic_indexloop() call with a call to a custom loop with a category filter, e.g. news_page_indexloop()
that calls this in functions.php
// Create a new indexloop function for the News page template.
function news_page_indexloop() {
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; else: endif; ?>
<?php query_posts(‘category_name=news&post_status=publish,future’);?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h2>”><?php the_title(); ?></h2>
<?php the_content(); ?>
<?php endwhile; else: endif;
}
Which brings me to my second problem: they break my functions.php with an unexpected "=" in the query_posts line, so I have to comment them out. The code seems solid, where did I mess up?
I can't seem to figure out why these problems are occuring. Can anyone help me figure this out?