Forum: Global Maps

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support related to the Global Maps premium extension please open a new premium support ticket.

[Resolved]set category in shortcode

Home Forums Global Maps set category in shortcode

This topic contains 13 replies, has 5 voices, and was last updated by  Digital Footprint 3 years, 7 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #48278

    Digital Footprint
    Participant

    Hi,

    Thanks for the great plugin. I was wondering, is it possible to filter by category in a form shortcode directly?

    Thank you,

    Tony

    #48314

    Eyal Fitoussi
    Keymaster

    You are welcome Tony, Thank you for the purchase.

    I was wondering, is it possible to filter by category in a form shortcode directly?

    I am not sure I understand, can you please explain what is that you would like to do?

    Thank you.

    #48813

    Digital Footprint
    Participant

    Hi Eyal,

    Actually I’m using a global map form by shortcode like that :

    [gmw form="1"]

    And I wanted to know if there was a way of specifying a taxonomy term in the shortcode. For example :

    [gmw form="1" include_terms="tourism"]

    I tried to search for an answer in the docs but couldn’t find anything for that.

    Thanks for your help.

    #48853

    Eyal Fitoussi
    Keymaster

    Unfortunately, it is not possible at the moment.

    Since the beginning, I developed GEO my WP forms builder to prevent the need to enter a bunch of shortcode attributes in order to set up a shortcode.

    Is there a reason why you would like to enter the terms this way instead of setting them up directly in the form?

    #48864

    Digital Footprint
    Participant

    Hi Eyal,

    Thanks for your response.

    The thing is that I have a lot of different categories (50+) and I wanted to generate the maps on each page instead of having to create all of them manually. Is that possible in some way?

    Thank you for your support.

    #49153

    Digital Footprint
    Participant

    Any news?

    #49156

    Eyal Fitoussi
    Keymaster

    Hi,
    Sorry for missing out your last reply.

    There is actually a way to do that.

    You can set the term ID that you would like to display for the shortcode using a term_id attribute ( or any other attribute that you’d like to use ). For example [gmw form=”3″ term_id=”12″] ( showing only posts with term ID 12 for form ID 3.

    Then place the below script in the functions.php file of your theme or child theme:

    The script will filter the map results based on the term_id you pass to the shortcode.

    Let me know if that helps.

    #49223

    Eyal Fitoussi
    Keymaster

    Hi,
    Just checking if you got to try the solution above and if it worked.

    #49349

    Eyal Fitoussi
    Keymaster

    This topic marked “Resolved” due to inactivity. If you wish to reply to this topic please change its status to “Not resolved”  before replying.

    #55260

    ivollaire
    Participant

    Hi, Eyal. I’m trying to do the same thing as is mentioned in this thread. I want to have a page that will show a user only results from a certain category when a page loads using the auto-locator functionality. I have this code in my functions file:

    The shortcode I’m using is:

    do_shortcode('[gmw form="1" term_id="65"]');

    Where ‘term_id’ is the category that I want displayed. This doesn’t work. Am I doing something wrong? Any help would be great.

    #55514

    Keshia Richmond
    Participant
    This reply has been marked as private.
    #56041

    Serge Ravet
    Participant

    Hi, I’ve added the function in functions.php, changed ‘3’ to ‘1’ (my first form). Then in a page I’ve added:

    [gmw form=”1″ term_id=”41″]
    [gmw map=”1″]

    Yet nothing is filtered based on the taxonomy ID… Any idea what the problem could be?

    Thx

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

The topic ‘set category in shortcode’ is closed to new replies.