Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

Creating a page of posts/PHP not working in custom main template?


 
Prev Previous Post   Next Post Next
  #1  
Old Jun 24, 2013, 04:29 PM
agent314
 
4 posts · Jun 2013
Creating a page of posts/PHP not working in custom main template?

I have recently installed the Montezuma theme and love the look and feel of it.

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(); ?>
And this is what appears, formatted with the style of the main body text of my page:


Code:
Content goes here.

'food-drink', 'posts_per_page' => -1 ) ); ?> '; the_title(); echo ''; the_excerpt(); the_date(); echo 'Categories: '; the_category(', '); echo '
'; endwhile; ?>
I've run the PHP through a parser and removed all errors it reported, but it still doesn't seem to work as expected.

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
 

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Creating custom template for page... wskdigital Atahualpa 3 Wordpress theme 2 Apr 11, 2013 06:19 PM
[SOLVED] custom main template for home page jerryc Montezuma Theme 4 Oct 6, 2012 09:42 AM
[SOLVED] creating posts from the main site janey73 Atahualpa 3 Wordpress theme 2 Jun 24, 2009 04:00 PM
Creating custom post template paulae Atahualpa 3 Wordpress theme 3 Mar 18, 2009 10:36 AM


All times are GMT -6. The time now is 04:10 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.