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 » Atahualpa 3 Wordpress theme » Center area post/pages » Post-Kicker, -Byline & -Footer »

Trying to modify the loop

Old Aug 23, 2009, 01:01 PM
7 posts · Aug 2009
Help Trying to modify the loop

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, 03: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, 01: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, 07: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, 08:24 AM
7 posts · Aug 2009
Flynn or anyone, is what I'm asking for possible using Atahualpa?
Old Aug 27, 2009, 06: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 02:29 AM
Only Pages in the loop sumochill Excerpts, Read more, Pagination 1 Aug 13, 2009 09: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 11:05 AM
Warning: Cannot modify header information - headers already sent by Stepien Header configuration & styling 4 May 8, 2009 07:50 AM
Modify H1 Headline for SEO idg Post-Kicker, -Byline & -Footer 12 May 4, 2009 10:05 PM

All times are GMT -6. The time now is 06:14 PM.

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