Blog Order

Discussion in 'StartPoint Business One Page WordPress Theme' started by amaconline, Jul 22, 2014.

Thread Status:
Not open for further replies.
  1. amaconline

    amaconline Member

    Joined:
    Feb 17, 2013
    Messages:
    217
    Likes Received:
    6
    Hi guys, kindly assist me to display the blog on the front-page.php in ascending or descending order. Thank you.
     
  2. Nitesh

    Nitesh Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    5,165
    Likes Received:
    160
    Hello,

    For this open front-page.php file and replace code shown in the image with the code given below.

    Code:
    <?php query_posts('showposts='.$thelimit. '&order=ASC'); if (have_posts()) : while (have_posts()) : the_post(); ?>
    Thanks & Regards
    Nitesh Raghuwanshi
     
    amaconline likes this.
  3. amaconline

    amaconline Member

    Joined:
    Feb 17, 2013
    Messages:
    217
    Likes Received:
    6
    Hi Nitesh, Please attach the image as we can not see the image. Thank you.
     
  4. Nitesh

    Nitesh Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    5,165
    Likes Received:
    160
    Hello,

    Replace code shown in the image.

    post order.png

    Thanks & Regards
    Nitesh Raghuwanshi
     
    amaconline likes this.
  5. amaconline

    amaconline Member

    Joined:
    Feb 17, 2013
    Messages:
    217
    Likes Received:
    6
    Hi Nitesh, Thank you. I am having one small problem. I am using the following code:

    Code:
    <?php
    $args = array(
    'category_name'=>'all-that-we-do'
    );
    $query = new WP_Query($args);
    ?>
     
    <?php query_posts('showposts='.$thelimit. '&order=ASC'); if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    Now, the blog is displaying in order but it is not reading the category above. Please help.

    Thanks.
     
  6. Nitesh

    Nitesh Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    5,165
    Likes Received:
    160
    Hello,

    Use this code.

    Code:
    <?php query_posts('showposts='.$thelimit. '&order=ASC'. '&category_name=your category'); if (have_posts()) : while (have_posts()) : the_post(); ?>
    Add your category name in place of 'your category'

    Thanks & Regards
    Nitesh Raghuwanshi
     
    amaconline likes this.
  7. amaconline

    amaconline Member

    Joined:
    Feb 17, 2013
    Messages:
    217
    Likes Received:
    6
Thread Status:
Not open for further replies.

Share This Page