Viewing 12 replies - 1 through 12 (of 12 total)
  • caimin_nwl

    (@caimin_nwl)

    Hi,

    Yes to both questions ??

    Let us know if you need more help with this.

    Thread Starter dlip

    (@dlip)

    It didn’t work. This is what I did: I created an attribute in the Settings. I then copied and pasted the following 2 pieces of code into functions.php in my theme folder. In the first snipped I changed the 4 mentions of STYLE to one of my attribute names: GENDER. IN the second piece I replaced the 3 mentions of STYLE with GENDER. I did Nothing else that’s listed in the Add-on Tutorial. But it doesn’t work. Any suggestions?

    add_filter('em_events_get_default_search','my_em_styles_get_default_search',1,2);
    function my_em_styles_get_default_search($searches, $array){
    	if( !empty($array['style']) && is_numeric($array['style']) ){
    		$searches['style'] = $array['style'];
    	}
    	return $searches;
    }
    add_filter('em_events_get','my_em_styles_events_get',1,2);
    function my_em_styles_events_get($events, $args){
    	if( !empty($args['style']) && is_numeric($args['style']) ){
    		foreach($events as $event_key => $EM_Event){
    			if( !in_array($args['style'],$EM_Event->styles) ){
    				unset($events[$event_key]);
    			}
    		}
    	}
    	return $events;
    }

    Thread Starter dlip

    (@dlip)

    FYI, I downloaded the entire code that’s included at the bottom of the add-on tutorial, saved it as php, uploaded it to Plugin folder, but nothing happened.

    Philip John

    (@philipjohn)

    Where exactly did you paste that code?

    You should be putting it in your theme’s functions.php, not in a plugin

    https://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/

    Thread Starter dlip

    (@dlip)

    Yup, that’s where I put it. But nothing happens. This is a serious issue as searching for other attributes is key.

    caimin_nwl

    (@caimin_nwl)

    So the second code snippet you posted above is in the functions.php file in your theme folder?

    Thread Starter dlip

    (@dlip)

    I saved the code as PHP and uploaded it to my Plugin folder, as instructed (found at https://d1mkunav5pg7l3.cloudfront.net/wp-content/uploads/2011/04/em-event-styles.txt). But it doesn’t seem to have made any changes.

    In short, I need to be able to achieve these 2 things:

    1. The user has to be able to search by custom attributes (using the search box, or at least with a pull down box)
    2. To filter event lits by the custom attributes.

    Thanks a lot!

    Thread Starter dlip

    (@dlip)

    Any ideas? In short, I just need to be able to Filter the events_list shortcode by the custom attributes I created under Settings.

    I’ve tried the tutorials, but they haven’t helped me (maybe I’m doing something wrong).

    Please help! Thanks again

    If you’ve added the code to your site as a plugin have you activated it?

    Thread Starter dlip

    (@dlip)

    The code is in the theme’s functions document, not a plugin.

    Again, I created attributes in Settings. They are showing on the Registration Form. Now, all I want is:

    a) that I can add them to shortcodes so that I can create a list of items that have that attribute

    b) that people can search for this attribute by typing it into the Events Manager search bar.

    Which Step of the code is needed from the tutorial document, and which words do I have to replace with my Attribute Name (which is ‘Gender’).

    https://wp-events-plugin.com/tutorials/creating-a-events-manager-add-on-a-complete-walkthrough/

    Thanks a lot. This will be lifesaving help.

    To add attributes to shortcodes, follow “Step 6 – Make styles searchable via shortcode attributes”.

    To integrate with the event search form, take a look at “Step 7 – Insert a style search drop-down menu into the events search form”.

    Hi,

    I started working with Events Manager and I believe it’s a great plugin, highly customizable.

    However, I am having the same problem as dlip. I have created a custom atribute for my events from the plugin settings and I can display it without problem in the event page, but I can′t integrate this custom atribute in the events search form (as a dropdown).

    I have copied the entire code of this tutorial in the functions.php of my theme, but nothing happened.

    https://wp-events-plugin.com/tutorials/creating-a-events-manager-add-on-a-complete-walkthrough/

    I didn′t change anything in the code because I wanted to see how it works by default, but I didn′t see any change in the back-end, neither in the front-end (on the events search form)

    I have also tried other approaches to get this working, for example using custom taxonomies, but I am not able to integrate it in the events search form

    https://www.ads-software.com/support/topic/plugin-events-manager-searching-by-custom-taxonomy?replies=10

    I would apreciatte any help, as the possibility of users being able to search by a custom atribute (i.e. Age and choose among children, young people, adults, etc) is a key feature on my website.

    Thanks in advance,
    Victor

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Searching by an attribute’ is closed to new replies.