Need Help!! Expired Listings

Discussion in 'GeoCraft WordPress Theme' started by senton, Apr 18, 2013.

  1. rogerschnur

    rogerschnur Member

    Joined:
    Mar 19, 2013
    Messages:
    216
    Likes Received:
    14
    Are these the only updates to the theme in 1.7.6?


    ---------------------------------------------------------------



    I've just updated the theme Nitesh - 1.7.6

    I can now re-publish listings but only one by one, by changing the 'Expiry Date' or via 'Publish' in 'Quick Edit'.

    When I select all 'draft' listings > 'edit' > 'publish'....they do not publish.

    I have hundreds of listings...this way will take me forever...

    How can I re-publish all of them at once?
     
  2. molatin

    molatin Member

    Joined:
    Aug 11, 2012
    Messages:
    558
    Likes Received:
    19
    I've just updated the theme Nitesh - 1.7.6

    I can now re-publish listings but only one by one, by changing the 'Expiry Date' or via 'Publish' in 'Quick Edit'.

    When I select all 'draft' listings > 'edit' > 'publish'....they do not publish.

    I have hundreds of listings...this way will take me forever...

    How can I re-publish all of them at once?
     
  3. Nitesh

    Nitesh Support Staff

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

    I think this code will help you
    paste this code in function.php and refresh business listing.
    Code:
     $wpdb->update('wp_posts',array('post_status' =>'publish' ), array( 'post_status' =>'draft' ),array('%s'),array( '%s' ));
    Check image for reference.
    [​IMG]
     
  4. molatin

    molatin Member

    Joined:
    Aug 11, 2012
    Messages:
    558
    Likes Received:
    19
    Thank you for that Nitesh - do I really have to do this with a code change?

    I thought this would be part of the regular theme settings - do update all listings from within the dashboard.

    It would make sense to do it that way, and then when I update the theme next time I would not have to redo the code.
     
  5. Gourav

    Gourav Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    7,728
    Likes Received:
    207
    Hello,

    Yes, you can make these changes in your code, it will publish your all business listing. We have not added this option in dashboard because it publish all listings (free listing also) mostly user of Geocraft theme do not want this option that's why we have not added this option in dashboard settings. You have to redo your .php changes every time after update of theme.
     
  6. molatin

    molatin Member

    Joined:
    Aug 11, 2012
    Messages:
    558
    Likes Received:
    19
    Do I include 'global $wpdb;' (shown in screenshot but not highlighted) or not?

    I tried updating the listings via the dashboard both ways but none worked.

    I am now getting hundreds of '
    Site Admin​
    ' emails...​


    Please advise.
     
  7. molatin

    molatin Member

    Joined:
    Aug 11, 2012
    Messages:
    558
    Likes Received:
    19
    I'm still getting hundreds of 'Site Admin' and 'List Activation' emails a day but cannot renew my listings.

    Can you please add a screenshot or video of exactly how to do this?

    High priority now - thank you.
     
  8. molatin

    molatin Member

    Joined:
    Aug 11, 2012
    Messages:
    558
    Likes Received:
    19
  9. Nitesh

    Nitesh Support Staff

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

    Please provide the following information listed below.

    Thread Link:
    Your Website URL:
    WordPress Username:
    WordPress Password:

    Send this information on our email at [email protected]
    We will renew your listing.
     
  10. molatin

    molatin Member

    Joined:
    Aug 11, 2012
    Messages:
    558
    Likes Received:
    19
    Hey Nitesh - I appreciate that - but I have 6 directories I am setting up.

    I need to be able to do this myself quickly and easily.

    Can you do a short video please? Thank you.
     
  11. Nitesh

    Nitesh Support Staff

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

    In latest version (1.7.7) we have added separate expiry date field for each listing.
    Publishing all listings directly through any code will not set next expiry time. So listings will expire again automatically.
    It is good to publish all listings manually. Yes it will take time but it is required.
     
  12. molatin

    molatin Member

    Joined:
    Aug 11, 2012
    Messages:
    558
    Likes Received:
    19
    Nitesh - I plan to have many directories, each with several hundred or thousand listings. If I have to re-publish them manually every time it will cost a lot of money to pay some one and take alot of time. It is not good or practical to publish all listings manually.

    Is there any reason why I cannot select the listing I wish to publish by ticking them and then making changes to all at once?

    That would make sense.
     
  13. Nitesh

    Nitesh Support Staff

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

    There is one more update for you.
    Add code given below in the function.php and remove it after listing publish.

    Code:
    global $wpdb;
    $data="SELECT * FROM wp_posts WHERE post_status = 'draft'";
    $queries = $wpdb->get_results($data);
    foreach ($queries as $query) {
    echo $post_id=$query->ID;
    $meta_key='gc_listing_duration';
    $post_status='post_status';
    $posttable='wp_posts';
    $meta_value='06/20/2013 07:15:45';
    update_post_meta($post_id, $meta_key, $meta_value);
    $wpdb->update($posttable,array($post_status =>'publish'), array( 'ID' =>$post_id ),array('%s'),array( '%d' ));
    }
    
    Change date and time in $meta_value. But keep in same format as now.
     

Share This Page