Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Post-Kicker, -Byline & -Footer »

Trying to modify the loop

Old Aug 23, 2009, 02:01 PM
7 posts · Aug 2009
Hey everyone,

I'm reading the codex regarding the loop and while I think I understand the code examples there, I'm having a hard time integrating it with this theme.

Currently I'm using the same loop but I need it to be modified so that it displays 5 posts from each of these categories: featured post, news, deals.

Here is the default code, can someone help me modify it to what I need it to be? TIA.

<?php /* Post Container starts here */ if ( function_exists('post_class') ) { ?>
	<?php query_posts('category_name=Deals&showposts=1'); ?>
	<div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>">
	<?php } else { ?>
	<div class="<?php echo ( is_page() ? 'page ' : '' ) . $odd_or_even . ' post" id="post-'; the_ID(); ?>">
	<?php } ?> <?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?> 
	<?php bfa_post_headline('<div class="post-headline">','</div>'); ?> 
	<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>
	<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>
	<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>	 
	<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>

	</div><!-- / Post -->
Old Aug 23, 2009, 04:34 PM
Flynn's Avatar
3,768 posts · Oct 2008
Munich, Germany
The code in the text area The LOOP is just the loop. query_posts code needs to be put before the loop, in Atahualpa's case into the text area above, named Content ABOVE the LOOP
Old Aug 24, 2009, 02:57 PM
7 posts · Aug 2009
Oh.. I wasn't aware of that at all. I'll have to give that a try today. That's probably why it's pretty messed up. Thanks, Flynn.
Old Aug 24, 2009, 08:12 PM
7 posts · Aug 2009
What Flynn said was correct. However, what if I have multiple loops? So for now, I want three loops:

<?php query_posts_deals('category_name=Deals&showposts=1'); ?>

<?php rewind_posts(); ?>
<?php query_posts_news = new WP_Query('category_name=news&showposts=1');

<?php rewind_posts(); ?>
<?php query_posts_featured_posts = new WP_Query('category_name=Featured Posts&showposts=1');
Should all three appear in the ABOVE LOOP section? Right now I think it shows the proper posts but also displays an error:

Parse error: syntax error, unexpected '=' in C:\xampplite\htdocs\wordpress\wp-content\themes\atahualpa.3.4.1\atahualpa\functions .php(389) : eval()'d code on line 14

How do I do this properly? My display could be wrong, because I only have one post for each category right now anyway. But anyway... any ideas?
Old Aug 26, 2009, 09:24 AM
7 posts · Aug 2009
Flynn or anyone, is what I'm asking for possible using Atahualpa?
Old Aug 27, 2009, 07:38 PM
Flynn's Avatar
3,768 posts · Oct 2008
Munich, Germany
For multiple loops you should create a new page template. Creating page templates has been discussed a few times here and there are also a few pages on the Wordpress.org codex. Keep in mind that multiple loops aren't easy especially if you want to keep proper next/previous page navigation.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning: Cannot modify header information - headers already sent by ... bruno-d-horse New Versions, & Updating 5 Mar 31, 2010 03:29 AM
Only Pages in the loop sumochill Excerpts, Read more, Pagination 1 Aug 13, 2009 10:52 AM
How to modify the links below each post on the homepage ? ( Date, tags , Leave a com. 3ukman Header configuration & styling 5 Jul 10, 2009 12:05 PM
Warning: Cannot modify header information - headers already sent by Stepien Header configuration & styling 4 May 8, 2009 08:50 AM
Modify H1 Headline for SEO idg Post-Kicker, -Byline & -Footer 12 May 4, 2009 11:05 PM

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

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