Support » Theme: ColorMag » I want to change sort of post days.

  • Hi,
    I realy loved this theme.
    but,I don’t know how to change sort of post days in index.php.
    I want to sort as ASC.
    I use as widget front page:slider area,front page/content middle left section and so on.
    like demo.
    I could change sort of post days in ardhive page.
    I add text below.
    <?php query_posts($query_string .’&order=ASC’);?>

    but, I don’t know where should I change php file for each widget in index.php’s sort of days.

    My url is
    http://bb-sapporo.com/cms_wp/

    Please tell me how to fix it.

    thanks.

Viewing 1 replies (of 1 total)
  • Hello,
    If you want to show the post in ascending order on archive you should first create a child theme of the theme, just to make sure the changes still remain even after the theme updates.
    To see how to build a child theme check https://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme

    After that copy the archives.php of the parents theme folder to the child theme folder and then find and replace the code from line 85 to 91 with the code given below.

    <?php
      $args = array('post_type' => 'post','order'=>'ASC');
      $query = new wp_query ($args);?>
      <?php global $post_i; $post_i = 1; ?>
      <?php while ( $query->have_posts() ) : $query->the_post(); ?>
      <?php get_template_part( 'content', 'archive' ); ?>
      <?php endwhile; ?>

    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘I want to change sort of post days.’ is closed to new replies.