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]Show only one category

Forums Support Show only one category

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #59619
    iba
    Member

    Hi, I have tried to show only one category like explained here:
    https://docsdep.geomywp.com/forums-site/topic/set-category-in-shortcode/

    but I don’t get is to work.

    This is teh shortcode:
    [gmw form=”3″ term_id=”24″]

    I use this in my functions.php:
    function gmw_gmap_set_default_taxonomy( $gmw ) {

    // abort if term_id is not set
    if ( empty( $gmw[‘params’][‘term_id’] ) )
    return $gmw;

    $gmw[‘page_load_results’][‘taxonomies’][‘usage’] = ‘include’;
    $gmw[‘page_load_results’][‘taxonomies’][‘tt_id’] = array( $gmw[‘params’][‘term_id’] );

    return $gmw;

    }
    // change the value 3 to your form ID
    add_filter( ‘gmw_default_form_values_3’, ‘gmw_gmap_set_default_taxonomy’ );

    #59675

    Hello iba,

    The script you mentioned is meant to work with the Premium Settings extension which allows your to include/exclude categories via the form editor.

    The script won’t work with GEO my WP core plugin alone.

    #59867
    paattal
    Member

    Hello,

    I have Premium Settings extension and I want to filter dynamically by term_id on posts locator form (#3 in my case).

    I try this code in functions.php but it doesn’t works.

    Is this code compatible with posts locator form or what can I modify to do it ?

    Thanks

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

You must be logged in to reply to this topic.