Show listing with pictures

This topic contains 5 replies, has 2 voices, and was last updated by  Paolo 8 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #58270

    Fredrik
    Buyer
    Post count: 67

    Hi,

    Is there any way to make the listings with pictures come before the ones without when looking at the listings page?

    Regards

    #58305

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    no there is no such sorting option.

    Sorry about that,

    #58521

    Fredrik
    Buyer
    Post count: 67

    Ok.

    As of now I modify the date on the post that has been updated which makes it appear before other listings on the /listing-success/ page. I have added some code in that file and want to move it out to be able to update geodirectory from time to time. However I don’t se anything to hook into in listing-success.php. Can you point me in the right direction?

    #58592

    Paolo
    Site Admin
    Post count: 31206

    Which file? listing-success.php is a template and you can move it inside your child theme in a folder called geodirectory.

    https://wpgeodirectory.com/docs/customizing-geodirectory-templates/

    Let us know if that helped.

    Thanks

    #58864

    Fredrik
    Buyer
    Post count: 67

    Cool, I did this and added code to listing-success.php.

    This is what I came up with, it might not be pretty but it works.

    ////////////////
    global $wpdb;
    $pid = $_GET[‘pid’];
    $date_has_image = current_time( ‘mysql’ );
    $date_no_image = date(‘mysql’,(strtotime ( ‘-30 days’ , strtotime ( $date) ) ));

    $image= $wpdb->get_var(“SELECT featured_image FROM wp_geodir_gd_place_detail WHERE post_id=’$pid'”);

    if ($image!= “” && $image!= NULL && $image!= “/path/to/standard/image/set/in/gd/options.jpg”) {
    $wpdb->query($wpdb->prepare(“UPDATE wp_posts SET post_date=’$date_has_image’ WHERE ID=’$pid'”));
    }

    else {
    $wpdb->query($wpdb->prepare(“UPDATE wp_posts SET post_date=’$date_no_image’ WHERE ID=’$pid'”));
    }
    ////////////////

    Thanks for the help.

    #58927

    Paolo
    Site Admin
    Post count: 31206

    You are welcome 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket