Jump to content
Sign in to follow this  
Gavin_

AddThis Facebook Like

Recommended Posts

Gavin_

Hi All we would like to add a social sharing function like that of AddThis or Facebook like - we have found some great plugins. However our challenge is that the plugin will add the like button to every post, banner, box, feature, page etc. etc. etc. we'd really just like it to appear on pages and posts and not boxes etc. any ideas? Thanks

Share this post


Link to post
Share on other sites
cmunns

You can hide it with CSS on the other post types, otherwise you'd have to edit the plugin since they didn't account for the option to hide on custom post types. Which plugin are you going to go with and I can help...a link to the site as well?

Share this post


Link to post
Share on other sites
bryan-hadaway

I recommend AddThis; here is the solution: ` .addthis{display:none} .page .addthis, .single .addthis{display:inline} ` Add to Custom Code > Custom CSS. Thanks, Bryan

Share this post


Link to post
Share on other sites
cmunns

You'd want to do this instead: ` .addthis{display:none} #theloop .addthis {display:inline} `

Share this post


Link to post
Share on other sites
Kate

Hey Gavin - Adam's code, slightly modified, should still work. Basically the issue was the class is different. Using either of these classes instead of ".addthis" should work: "addthis_counter" "addthis_pill_style"

Share this post


Link to post
Share on other sites
Gavin_

Hi Kate, Adam and Bryan I have tried all the suggestions and every possible combination I can think of and i still can't seem to stop these pesky addthis buttons appearing on boxes and banners! Any more ideas?

Share this post


Link to post
Share on other sites
Sourena

The quick solution (but not the most efficient) is to add a widgetised area under your posts and pages, and add the sharing buttons there. The plugin you use needs to have widgets. If the plugin you use does not have a widget but uses a "short-code" you might still be able to use it. In that case drag and drop a Text widget there and place your short code inside the text widget.


alefba.us

Web Development & Design for Right-to-Left languages

Share this post


Link to post
Share on other sites
Gavin_

Thanks Sourena neat idea - but Addthis doesn't give you much flexibility in terms of how you add - i cannot see a shortcode or a widget. it appears to automatically add to every page and post. and it considers the banners and boxes to be pages and/or posts. if i could add it as a widget your idea would work. maybe i should try a different plugin??

Share this post


Link to post
Share on other sites
Sourena

Of course it does. If you use AddThis Social Bookmarking Widget from The AddThis you can disable the plugin to automatically appear under or over the posts and pages but you still can place the Addthis widget on a widgetized area. On the widget you have all the options you have on the settings page. You can also use ShareThis plugin. It does not have a widget but it gives you HTML codes that you can copy/paste in a text widget. It should work fine.


alefba.us

Web Development & Design for Right-to-Left languages

Share this post


Link to post
Share on other sites
Gavin_

yep i worked that out after i had posted - however a quick test revealed that what you were liking or tweeting was the widget the html was enclosed in and not the page. so not ideal at all... at the moment i am going cross eyed reading all the functionality on different plugins. it seems an obvious yet vital feature that lets you exclude the appearance of the plugin on certain posts or pages is as elusive as a four leaf clover.

Share this post


Link to post
Share on other sites
cmunns

Well like I said we can go ahead and edit the plugin, I was just optimistic about it working with CSS. For example in addthis look for the addthis_social_widget.php file and look for this code: ` // add nothing to RSS feed or search results; control adding to static/archive/category pages if (!$onSidebar) { if ($addthis_settings['sidebar_only'] == 'true') return $content; else if (is_feed()) return $content; else if (is_search()) return $content; else if( get_post_type() == 'features' ) return $content; else if (is_home() && !$addthis_settings['showonhome']) return $content; else if (is_page() && !$addthis_settings['showonpages']) return $content; else if (is_archive() && !$addthis_settings['showonarchives']) return $content; else if (is_category() && !$addthis_settings['showoncats']) return $content; } ` You see I've already added to this block the bit about post_type==features...this is the sort of thing you have to add to exclude it from those post types.

Share this post


Link to post
Share on other sites
Gavin_

Hi Adam I added the code and the add this is still appearing in boxes and banners please see here http://www.atab.org.uk/know-your-rights/ this is what i have // add nothing to RSS feed or search results; control adding to static/archive/category pages if (!$onSidebar) { if ($addthis_settings['sidebar_only'] == 'true') return $content; else if (is_feed()) return $content; else if (is_search()) return $content; else if( get_post_type() == 'features' ) return $content; else if( get_post_type() == 'boxes' ) return $content; else if( get_post_type() == 'banners' ) return $content; else if (is_home() && !$addthis_settings['showonhome']) return $content; else if (is_page() && !$addthis_settings['showonpages']) return $content; else if (is_archive() && !$addthis_settings['showonarchives']) return $content; else if (is_category() && !$addthis_settings['showoncats']) return $content; } any ideas would be greatly appreciated. or even a totally different solution.... thanks

Share this post


Link to post
Share on other sites
Andrew

Gavin, getting a little complicated with this one. Don't the options in the plugin have something for this?

Share this post


Link to post
Share on other sites
Gavin_

Hi Andrew not that I can see - if there is another plugin that does i'm happy to use it cheers

Share this post


Link to post
Share on other sites
bryan-hadaway

This is getting a bit silly, I use AddThis all the time and use CSS to hide it where I don't want it, we can do this :). Please provide a link (again for easy reference) and make sure to have AddThis activated. Also, it's important that you learn how I'm going about testing this: http://www.pagelines.com/docs/changing-colors-fonts Thanks, Bryan

Share this post


Link to post
Share on other sites
Gavin_

Hi Catrina That has worked to remove the addthis from the boxes. thanks You can still see them in the banners but i think i can work that out now. many thanks. shame their isn't a super best answer button.

Share this post


Link to post
Share on other sites
matthew_anderson

I'd also be curious to see some code to prevent AddThis from showing up in banners and features. It currently is doing both at mereo.rezitech.net. matt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×