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 »

Posts only from two categories with different number of posts


  #1  
Old Dec 21, 2010, 09:33 AM
Flinxa
 
70 posts · Sep 2010
Hi

I am still struggeling with showing posts from certain categories on the start page.

I want from two categories post, 2 from the first, 3 from the second

I got some help from the german woprdpress forum with some pHp-Code

PHP Code:
<?php if (is_home() || is_front_page()) { ?>

<?php $first_query = new WP_Query("cat=2&posts_per_page=3");
if (
$first_query->have_posts()) : while ($first_query->have_posts()) : $first_query->the_post(); ?>
...
...
<?php endwhile; endif; ?>

<?php $second_query = new WP_Query("cat=5&posts_per_page=3");
if (
$second_query->have_posts()) : while ($second_query->have_posts()) : $second_query->the_post(); ?>
...
...
<?php endwhile; endif; ?>

<?php ?>
But now I don't know what to put there for the "..." and how I combine this with the usual code in the loop

Anyone better with pHp and the loop than me??

Thanks
Flinxa

Last edited by Flinxa; May 14, 2011 at 04:12 AM.
  #2  
Old Dec 22, 2010, 12:03 AM
Flinxa
 
70 posts · Sep 2010
Thanks for this hint

I will have a look at the index.php and see what I can do

Just another question: when I change code in the index.php, do I have to change anything in the ATO - Loop section?

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Limit number of posts on home page? anishinaboy Page & Category Menu Bars 2 Jul 11, 2010 12:34 PM
Number of posts on main page RyanDe680 Center area post/pages 1 Jan 11, 2010 04:45 AM
Can't increase number of Recent Posts kmagyarics Sidebars & Widgets 3 Nov 21, 2009 06:23 AM
Limit the number of posts per page mcgiver058 Atahualpa 3 Wordpress theme 1 Aug 20, 2009 09:01 PM
how to show only categories with a high number of posts ? elpidiofilho Atahualpa 3 Wordpress theme 4 Mar 17, 2009 02:43 PM


All times are GMT -6. The time now is 08:00 PM.


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