Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Adding another Form to Classified Adverts

  1. #11
    Newbie
    Not a Verified Customer
    pl4y312's Avatar
    Join Date
    Aug 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding another Form to Classified Adverts

    Hi,

    I got this problem too.
    But in my observation (with google :P), I got this

    http://wordpress.org/support/topic/286391

    here's the script
    Code:
    $querystr = "
       SELECT wposts.*
       FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
       WHERE wposts.ID = wpostmeta.post_id
       AND wpostmeta.meta_key = 'price'
       AND wposts.post_type = 'post'
       ORDER BY wpostmeta.meta_value+0 DESC
       ";
    But I don't know where I should put this script.
    Anyone can help?
    Or that is similar solution like dcowgill said

    Regards,
    pl4y312

  2. #12
    Amateur
    Not a Verified Customer
    thedave's Avatar
    Join Date
    Jun 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding another Form to Classified Adverts

    Bump.

    As stated in the first post of this string. This is an extremely important feature that is included in this theme. It should work properly. Has anyone figured out a fix?

  3. #13
    Amateur popsoul's Avatar
    Join Date
    Oct 2009
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding another Form to Classified Adverts

    Found this solution to the whole Price sorting issue.

    http://wordpress.org/support/topic/277454

    Basically you use this in your sort links
    <a href="?sort=meta_value_number&key=price&order=asc" >
    <a href="?sort=meta_value_number&key=price&order=desc ">

    But then you have to make a few edits to WP. In the main wordpress directory (not classipress) go inside the wp-includes folder and open the query.php file. Then do the following:

    go to line ~2035, after $allowed_keys[] = 'meta_value'; add
    $allowed_keys[] = 'meta_value_number';

    go to line ~2057, after break; add
    case 'meta_value_number':
    $orderby = "$wpdb->postmeta.meta_value+0";
    break;

    I did it and it works for me. If those lines aren't exact for you you may not be up to date with your wordpress. Try upgrading or do a search for the value they said to put your new code in after.

    good luck

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)