WordPress.org

Ready to get started?Download WordPress

Forums

Intuitive Custom Post Order
Sorting in ASC order (3 posts)

  1. sykot
    Member
    Posted 1 year ago #

    <?php
    query_posts( "cat=3&posts_per_page=3&order=ASC" );
    while (have_posts()) : the_post();
    ?>

    ASC order is not working... showing always in DESC order

    Can you help?

    Regards,

    http://wordpress.org/extend/plugins/intuitive-custom-post-order/

  2. supertomate
    Member
    Posted 1 year ago #

    Hi Sykot,

    all the function is in the main php file of this plugin :

    add_filter( 'posts_orderby', 'hicpo_posts_orderby' );
    function hicpo_posts_orderby($orderBy) {
    	global $wpdb;
    	$orderBy = "{$wpdb->posts}.menu_order, {$wpdb->posts}.post_date DESC";
    	return( $orderBy );
    }

    Either you modify this file, or you add in your theme function.php a similar function

  3. hijiri
    Member
    Plugin Author

    Posted 1 year ago #

    Hi there,
    In the lasted version(1.1.0 later), I improved.
    Please try this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.