Multiple loops on one page( theme's index.php) (1 post)

  1. Mian Majid
    Posted 3 years ago #

    Hello, i am creating custom theme and want show one posts of category id=3 in slider and lower then are three boxes, one for home page summery with title and read more, second box is for category id=4 that have latest news and third box is for category id=5 for our services.
    I tried two loops at current stage
    but home page query not showing any data, while slider of category=3 is running fine. following are queries
    this is of slider query, i used wp_reset_query(); after the loop end.

    $featuredPosts = new WP_Query('post_type=post&showposts=4&cat=3');
    while ($featuredPosts->have_posts()) : $featuredPosts->the_post();

    following is the query to call the one page content that i created with the title of Home Page.

    $homePage = new WP_Query('pagename=home-page');
    while ($homePage->have_posts()) : $homePage->the_post();

    NOTE: when i select Static Page (Home Page) from Reading Setting, it shows only page box content and failed the query of slider, when i select Latest Posts then it shows only slider posts and disappear page box content.

    thank you very much for your time. please guide me what to do.

Topic Closed

This topic has been closed to new replies.

About this Topic