Support

Home Forums Social Media Buttons Add-on How to turn off social media buttons

How to turn off social media buttons

Posted: November 15, 2013 at 2:25 pm


fjmcmidwest

November 15, 2013 at 2:25 pm

The default location of the social media buttons — right in the middle of the registration process — is awkward. I’ve seen previous forum posts suggesting various hacks to move the buttons to a better place. Is there a better solution (yet) that would avoid hacking the PHP?

I’m ok with just turning off the feature. I could do that by disabling the plugin or using display:none in the custom CSS. Is there a simple option to turn off the social media buttons for one event but leave them on for another?


Josh

  • Support Staff

November 15, 2013 at 3:06 pm

Hi Jonathan,

While there isn’t a simple option to turn off the social buttons for one event only, the buttons are displayed via a WordPress action hook. So a little function can be added via a custom function file (like your theme’s functions.php file or a custom functionality plugin) to remove the buttons for the one event.

The action hook in question is:

do_action('action_hook_espresso_social_display_buttons', $event_id);

So to remove the buttons for the event with the ID of 5 you’d use a function like this:

With moving the buttons without altering the template files: It depends on where you want to move them. Elements can also be moved around on the page with CSS or even jQuery.


fjmcmidwest

November 15, 2013 at 5:41 pm

Thanks for the quick response, Josh. I don’t know about the rest of your customers, but I seriously want to stay away from PHP if I can help it. So I accomplished what I needed with CSS:

.ee-social-media-buttons {
display: none;
}

Of course that deletes the buttons from ALL events, but I imagine there’s a way to narrow down the CSS declaration to a specific form. In any case, I only have one event for now so it’s really not a problem.

For those reading this post, I focus on CSS wherever possible, instead of editing the PHP files, because I don’t have to worry about my edits getting wiped out when the theme updates, and I don’t have to create a child theme. (I use the custom CSS function included in JetPack.)


Josh

  • Support Staff

November 15, 2013 at 7:17 pm

Hi Jonathan,

It turns out you can place the PHP code I posted above in your own custom function file and it will not get lost on a theme or plugin update. This tutorial outlines the recommended way to install your own little plugin where you can add little PHP functions:

http://ottopress.com/2011/creating-a-site-specific-snippets-plugin/

The support post ‘How to turn off social media buttons’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso