• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Need this code on bbPress Forum & Topic Pages Only

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Need this code on bbPress Forum & Topic Pages Only

This topic is: resolved

Tagged: bbPress, hooks, php, share buttons, sharing

  • This topic has 5 replies, 2 voices, and was last updated 12 years, 4 months ago by AnitaC.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • February 2, 2013 at 8:28 am #17341
    AnitaC
    Keymaster

    I am trying to get this code to work to help out on another forum topic - http://www.studiopress.community/topic/help-with-jetpack-sharing-icons-on-bbpress-forums-and-going-green-child-theme/).

    How can I get the following code to work on the Forum & Topic Pages only? When using the Share buttons. If we use simple hooks and place this code in the "before_post_content" and execute PHP for example - it is appearing on all pages and posts. We only want it at before post content on Forum & Topic Pages - we want the share buttons to continue to be placed in the footer as it normally does.

    <?php echo sharing_display(); ?>

    I guess there are others out there trying to figure this out on bbPress forums and also on WordPress.org.

    Thanks in advance.


    Need help with customization or troubleshooting? Reach out to me.

    February 3, 2013 at 12:41 am #17561
    AnitaC
    Keymaster

    Would someone be able to assist with this? Thanks.


    Need help with customization or troubleshooting? Reach out to me.

    February 4, 2013 at 7:57 am #17824
    David Decker
    Member

    Hi there!

    You have to make sure to not hook this in globally but only on bbPress pages.

    So I have come up with this solution:

    Place the code in your functions.php or a functionality plugin. (without the opening "< ? php" please!)

    This displays it at begin of single forums view, at begin of single topic view (also for lead topics!).
    If you want to display on every reply then you have to uncomment the included line with the action hook.
    Otherwise comment out any action_hook line that you don't want to use.

    Just tested this code myself and was working great 🙂


    Twitter @deckerweb // Google+ // My Genesis & WordPress Plugins // German Translations for Genesis

    February 4, 2013 at 8:00 am #17826
    AnitaC
    Keymaster

    Oh David, thank you. One little question - if they wanted to move the Share buttons to a different hook area where would they change that?

    There is a discussion here where people are looking too for this answer - http://bbpress.org/forums/topic/social-media-share-button-missing/. Not sure if you want to post your "great" coding solution there or not.


    Need help with customization or troubleshooting? Reach out to me.

    February 4, 2013 at 9:19 am #17852
    David Decker
    Member

    I'll post that later on on this bbpress.org forum 🙂

    Yes, you can change the hooks from bbPress but make sure they belong to the loop. bbPress has so many hooks just try another one that better fits your needs. Most of them are not documented yet, I always look into the very source code... 🙂

    I hope I understand your point correctly.

    Just on the go, might check it later this evening again...
    -Dave 🙂


    Twitter @deckerweb // Google+ // My Genesis & WordPress Plugins // German Translations for Genesis

    February 4, 2013 at 11:44 am #17928
    AnitaC
    Keymaster

    You did and thanks again for helping!


    Need help with customization or troubleshooting? Reach out to me.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Need this code on bbPress Forum & Topic Pages Only’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble