I am trying to get this code to work to help out on another forum topic - http://www.studiopress.com/forums/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.
Would someone be able to assist with this? Thanks.
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
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.
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...
You did and thanks again for helping!
The topic ‘Need this code on bbPress Forum & Topic Pages Only’ is closed to new replies.
Subscribe to get early access to new themes, discounts and brief updates about what's new with StudioPress!