Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   Posts only from two categories with different number of posts (http://forum.bytesforall.com/showthread.php?t=11837)

Flinxa Dec 21, 2010 09:33 AM

Posts only from two categories with different number of posts
 
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

Flinxa Dec 22, 2010 12:03 AM

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?


All times are GMT -6. The time now is 03:43 PM.

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