Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter nagman

    (@nagman)

    Er… I don’t know, but I don’t think so. If it’s not installed by default, no.

    Thread Starter nagman

    (@nagman)

    Forget my previous question (about order in the query) cause I’ve answered it myself by trying to resolve another issue: it first filters by category ID, then by keyword, and finally do the haversine formula. So the query is optimized for better performance ??

    Concerning the GMAP API, I’ll keep the plugin as is, cause like I said I host my website on a dedicated server, and the max number of queries I’ll do won’t be higher than 19,000, and it will be a one-shot. GMAP API is limited to 2,500 daily free requests, so I’ll just spread my import on 8 days (2,375 requests per day).

    And finally I’ve got my answer to my issue!

    If anybody encounters the same issue, i.e. when doing a WP_GeoQuery with lat/lng AND a taxonomy (or a meta_query) returns 0 results, here’s the answer:
    https://github.com/fyaconiello/wp-geo-posts/issues/7

    Thread Starter nagman

    (@nagman)

    Thank you for the explanation.

    But if I want to keep the metabox, I should keep the other files, isn’t it?
    Cause geo-query.php only manages the query, not the metabox and the saving process into the database.

    The issue about the gmap api concerns the metabox, am I right?
    So, once the fields are completed in the admin, there is no more calls to the API, logically.
    I read on the gmap doc: daily free quota of 100,000 requests per 24 hours.
    My server is dedicated, and I wont do 100,000 requests per day, with all the other websites on it. My database is limited to 19,000 posts, and once they’ll be published they wont move.

    Did I understood well? Or does something escape me?

    For the categories, you don’t seem to have any clue. I’ll stick my nose into this.

    And last but not least, maybe I’m not in the right place to ask this, but my real question about the order of the query is: does those filters you’re adding affect in anything the time it’ll take to retrieve the data from the database? I mean will it take much longer? Will it calculate the haversine on each of the 19,000 posts BEFORE checking the keyword or the category? Or will it first filter the keywords AND categories BEFORE calculating the haversine?

    This last question is the most important cause I want my site to be reliable when doing lot of queries.

    Thread Starter nagman

    (@nagman)

    Oh… I see. Actually, my website is already on a production server (a dedicated server).

    I don’t know if I’ll succeed in modifying the plugin (I haven’t built any plugin before) but I’ll try.

    What part of the plugin had to do with gmap geocoding? The admin metabox?

    Also, do you have an aswer for my previous question? About order of parameters in the query (keyword and category before location). Cause when I search for a post in paris, it returns the right post. When I search one of its categories, it returns also the same post. But when I search for the same category IN paris, it returns nothing.

    Thread Starter nagman

    (@nagman)

    Actually, the search doesn’t work when it combines category and geolocation.
    With keywords it’s ok, yet.

    Thread Starter nagman

    (@nagman)

    Actually, the site I’m changing already had the superlist theme. Otherwise I would never install a wordpress theme in order to change it (to many issues and complications – much better to create the theme on my own). And the superlist theme doesn’t have any documentation for developers.

    I asked their support team and they redirected me here.

    But I’ll ask them the code you’re asking me.

    Thread Starter nagman

    (@nagman)

    Oh, yes. That’s true: I’m using the superlist theme, which integrates CMB2. And the plugin is directly managed into the admin panel.

    Thread Starter nagman

    (@nagman)

    Ok, I understand. Where do I find the CMB2 code generated by the plugin?

    Thread Starter nagman

    (@nagman)

    You don’t need the html form to understand, as I don’t use it for now because I’m doing all the test stuff directly with php :

    if(is_singular(“expert”)){
    if($_POST[“submit_button”]){
    $postID = get_the_ID();

    $categoriesToSave = array(295, 377, 281, 287, 278);
    wp_set_object_terms( $postID, $categoriesToSave, “listing_categories”);
    }
    }

    I simplified the code because the rest is unimportant. But all my code works fine except wp_set_object_terms().

    Also, I can’t give you the code used to create the metabox because I created it in the admin panel. However I can give you the parameters used for the field:
    id: cats
    type: multicheck taxonomy
    taxonomy: categories
    metabox: expert: categories

    Hope that will help you to understand.

    Thread Starter nagman

    (@nagman)

    I also tried with wp_set_object_terms( $postID, $categories, "listing_categories"), where $categories is an array(285, 286, 288, 295) and listing_categories the taxonomy linked. It didn’t work.

    Thread Starter nagman

    (@nagman)

    The code I’m using is:

    update_post_meta( $postID, ‘listing_expert_cats’, json_decode($_POST[‘categories’]) );

    where ‘listing_expert_cats’ is the custom field slug (a multicheck taxonomy field) and ‘categories’ is an array(true, false, true, true, etc.).

    I also tried with an array(‘category1’, ‘category3’, ‘category4’, etc.).

    Thread Starter nagman

    (@nagman)

    Ah…

    Strangely enough, it works now.

    I don’t know why…

    Thread Starter nagman

    (@nagman)

    Well thanks for your answer.

    Do you know when you’ll be able to release this update?
    In order for me to know if it’s better to wait or to fix manually the issue by myself.

Viewing 13 replies - 1 through 13 (of 13 total)