GEO my WP Support

Use this forum for technical support and general questions related to GEO my WP plugin and its core add-ons only. For technical support and general questions related to any of the premium extensions please open a new premium support ticket.

[Not resolved]Include only 1 category on the GEO MY WP page

Home Forums Support Include only 1 category on the GEO MY WP page

This topic contains 1 reply, has 2 voices, and was last updated by  Eyal Fitoussi 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #59405

    Irenuzza
    Participant

    Hi guys,
    So, I have a page Tailors that is showing a map of all the tailors in the country.
    However, every post I entered in the Blog page is displayed on the map as well! I’ve made the location not mandatory, so I can delete it from the Blog’s posts, but they are still there.

    I tried the theme’s support (ReHub), by asking for a code that can include only that 1 category, they say it’s not up to them as that page uses GEO WP search results, not the theme ones (whatever that means).

    We tried this code, and it didn’t do anything at all:

    function my_tailors_category( $query ) {
    if ( $query->is_page(1004) && $query->is_main_query() ) {
    $query->set( ‘cat’, ‘160’);
    }
    }
    add_action( ‘pre_get_posts’, ‘my_tailors_category’ );

    Help plz!
    Thank you,
    I.

    #59424

    Eyal Fitoussi
    Keymaster

    Hello @irenuzza,

    To include a specific category you need to modify the search query of GEO my WP. You should look into the filter ‘gmw_pt_search_query_args’ which you can find in geo-my-wp/plugin/posts-locator/includes/class-gmw-posts-locator-form.php.

    You can also look into the Premium Settings extension which one of its features is to include/exclude specific categories from the form.

    I hope this helps.

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

You must be logged in to reply to this topic.