O3 Social Share
Enable plugin in WordPress pages (6 posts)

  1. rainerkruger
    Posted 4 years ago #

    Hy everybody, Tanks a lot for this plugin, works very fine.

    Im my site, I want put this pluing in my pages, not only in posts. Then, I made a small hack to work and I want to confirm if correct:

    on wp-content/plugins/o3-social-share/o3-social-share.php I change the line 45:

    from if(is_single($post->ID))

    to if(true)

    Have this a problem?
    And then I put the method <?php o3_output_social_plugins(); // Get o3 Facebook plugin ?> in page.php.

    Rainer Kr├╝ger


  2. Brian Onorio, O3
    Plugin Author

    Posted 4 years ago #

    You shouldn't need to call the o3_output_social_plugins(); at all if you change the line 45 as you did.

    What that line does is check to see if it is a single page. Alternatively, you can change that line to

    if(is_sinuglar($post->ID) which will check to see if it is either a Post or a Page (or a singular item of a custom post type).

    Everything else should work dandy.

    I'll note this for the next update to include the ability to also post to Pages.

  3. Brian Onorio, O3
    Plugin Author

    Posted 4 years ago #

    We've released version 1.1 of the plugin. It now has native options to allow you to add to posts or pages. Get the update!

  4. bhomatude
    Posted 4 years ago #

    Hi Brian --

    I'm trying to drop this into the entry-utility div of a thematic child theme and can't seem to get it to work. Anything I put between ' ' will show up no problem... just not this code or variations on it. I feel that I'm missing something super simple.

    function my_postfooter($postfooter) {
    $postfooter = str_replace("</div><!-- .entry-utility -->\n", '', $postfooter);
    $postfooter .= '
    $postfooter .= 'echo o3_output_social_plugins()' ;
    $postfooter .= "</div><!-- .entry-utility -->\n";
    return $postfooter;
    add_filter('thematic_postfooter', 'my_postfooter');

  5. Brian Onorio, O3
    Plugin Author

    Posted 4 years ago #

    The ot_output_social_plugins function returns as a variable. You can't assign an echo request to a variable. PHP take the echo command and outputs it. That data can't be assigned.

    What you need to do is:
    $postfooter .= o3_output_social_plugins();

  6. bhomatude
    Posted 4 years ago #

    Thanks, Brian!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • O3 Social Share
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic