WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddThis
[resolved] [Plugin: AddThis] Adding AddThis buttons to custom content types (2 posts)

  1. jbx
    Member
    Posted 1 year ago #

    When I am adding AddThis to my Custom Content Types (specifically Events through the Event Manager plugin) the links, although present in the page when I do Inspect Element, are not displayed.

    When I compared normal Posts with the Custom Content Type pages I noticed that the top <script> and <link> includes for the Javascript and CSS for AddThis are missing.

    Note that I am including the AddThis using the custom options (not Before or After). I.e. using the approach documented here.

    I also followed the instructions here and added the following to my functions.php:

    add_filter('addthis_post_exclude', 'addthis_post_exclude');
    function addthis_post_exclude($display)
    {
    //display always, wherever I want!
      $display = true;
      return $display;
    }

    However to no avail.
    How can I force AddThis to display where I want it on Custom Content Types or pages that I want?

    http://wordpress.org/extend/plugins/addthis/

  2. jbx
    Member
    Posted 1 year ago #

    The reason was that the_content() was not being called in these special custom content types.

    Its working fine now that I added the_content() and fixed the content types to play well with the the_content() function.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic