Home › Forums › Pro Support › Add Social to post pages only
Tagged: social media
- This topic has 17 replies, 3 voices, and was last updated 2 years, 9 months ago by
Tom.
-
AuthorPosts
-
November 27, 2020 at 1:57 pm #23198
Jennifer
ParticipantHello,
I just purchased your pro plugin, love it by the way, and was wanting to know is there a way to add a hook to show only the social media part?
I have this plugin and your Generatepress Lifetime Theme.
I like how you coded it and is very lightweight. I like that it has a heart and no thumbs down.
Okay can you please let me know if we can add the social media part only to our post pages.
Thank you
November 27, 2020 at 2:42 pm #23207Jennifer
ParticipantLet me explain a little better. I have the pro WP Show Post plugin. Within that plugin you can add social media to your WP Show Post. What I would like to know is since you created a lightweight social media section for WP Show Post is there a way to add this social media part only to Post pages globally using a hook?
https://livinghisword.org/wp-content/uploads/2020/11/wpshowpost1.png
https://livinghisword.org/wp-content/uploads/2020/11/wpshowpost2.png
https://livinghisword.org/wp-content/uploads/2020/11/wpshowpost3.pngThis would be a great addition to our post pages.
November 28, 2020 at 12:02 pm #23319Jennifer
ParticipantHi there,
Was just wondering if my question was okay to ask or your thinking about it or this is not possible, any feedback would be great, thank you :).
November 29, 2020 at 9:08 pm #23404elvin
ModeratorHi,
My apologies for the response delay.
What I would like to know is since you created a lightweight social media section for WP Show Post is there a way to add this social media part only to Post pages globally using a hook?
You can definitely place your own markup or lightweight social media shortcodes using the
wpsp_after_content
hook.Example:
add_filter( 'after_setup_theme', function(){ remove_action( 'wpsp_after_content', 'wpsp_add_social_sharing', 10 ); add_action( 'wpsp_after_content', function(){ // do your thing here example: do_shortcode('[social_icon_widget_plugin_shortcode"]'); or echo get_field('sample_custom_acf_field'); }, 10 ); });
What this does is it removes the default social icons and replaces it w/ an action hooking whatever you add within the
add_action( 'wpsp_after_content', function(){ // do something here });
.November 30, 2020 at 3:57 pm #23462Jennifer
ParticipantHi there,
Thank you for the reply and for the help. However, I don’t want to replace social media on the post page I want to add the WP Show Post social media on the post page. Can you provide the shortcode to add wpsp_add_social_sharing.
You provided on how to remove it so can you provide one on how to add it?
Thank you
December 1, 2020 at 11:00 am #23540Tom
KeymasterHi there,
WPSP wasn’t built to affect single post templates. You’re definitely better off using a social sharing plugin that’s meant to do this.
However, if you want to use the WPSP code, you could try hooking it into your theme, depending on whether they have hooks available. In GP, you could try this:
add_action( 'generate_after_content', function() { if ( ! is_single() ) { return; } // order of args: ID, Twitter, Facebook, Pinterest, Love, alignment. echo wpsp_social_sharing( get_the_ID(), true, true, true, true, 'left' ); } );
Again, this is telling WPSP to do something it wasn’t built to do, so not 100% sure it will work, but the idea is there 🙂
December 1, 2020 at 2:09 pm #23563Jennifer
ParticipantOkay this great and were almost there. Do you think you could help me a little further. By the way I do have Generatepress Pro.
I added the code you provided to my functions.php file. The love number is showing but nothing else, however the code is there. Any reason why it is not showing up?
https://livinghisword.org/wp-content/uploads/2020/12/WPSHOWpost1.png
https://livinghisword.org/wp-content/uploads/2020/12/WPSHOWpost2.pngSo close :)!
Thanks Tom
December 1, 2020 at 2:21 pm #23565Jennifer
ParticipantThe code is the same when adding the social to the WP Show Post. So hmmmm!
https://livinghisword.org/wp-content/uploads/2020/12/WPSHOWpost3.png
December 1, 2020 at 2:30 pm #23567Jennifer
ParticipantOkay the code is the same but it is missing the ::before code. How do you add this so the social icons show up?
https://livinghisword.org/wp-content/uploads/2020/12/WPSHOWpost4.png
https://livinghisword.org/wp-content/uploads/2020/12/WPSHOWpost5.pngDecember 2, 2020 at 12:33 pm #23653Tom
KeymasterHmm, so the CSS isn’t being generated on that page.
Any chance you can link me to it?
December 2, 2020 at 3:08 pm #23673Jennifer
ParticipantSure, how do I provide the sensitive information?
Oh and it is not just this one particular page. It is for all post pages.
December 4, 2020 at 12:47 am #23761elvin
ModeratorHi,
Sure, how do I provide the sensitive information?
Oh and it is not just this one particular page. It is for all post pages.
You can send your details here:
https://wpshowposts.com/contact/Please include the link to this topic on your message. Thank you.
December 5, 2020 at 11:28 am #23837Jennifer
ParticipantOkay I just emailed you the credentials, thank you again.
December 7, 2020 at 3:25 pm #23935Tom
KeymasterHmm yea, this is what I feared, unfortunately. None of the styles are loading as they’re built to only load when the post list is loaded.
In this case, it’s best to have a separate solution for single posts, unfortunately.
Sorry I can’t be more helpful!
December 9, 2020 at 6:46 pm #24065Jennifer
ParticipantOkay thank you for trying to help me. Is there a way to add my own social media using a hook within your WPShow Post section? Or can I add my own to your WP Show Post?
By the way I do have Generatepress Pro version.
Here is the code
<?php $postUrl = 'http' . ( isset( $_SERVER['HTTPS'] ) ? 's' : '' ) . '://' . "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; ?> <section class="share_wrapper"> <div style="font-size:28px;font-style: italic;color:#cf686f">Share The Love Of Christ</div> <div class="shareBTN"> <a target="_blank" href="https://twitter.com/intent/tweet?url=<?php echo $postUrl; ?>&text=<?php echo the_title(); ?>&via=<?php the_author_meta( 'twitter' ); ?>" title="Tweet this"><img src="https://livinghisword.org/wp-content/uploads/2020/03/twitter.png" alt="twitter" class="ShareBTN"></a> <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $postUrl; ?>" title="Share on Facebook"><img src="https://livinghisword.org/wp-content/uploads/2020/07/facebook.png" alt="facebook" class="ShareBTN"></a> <a target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo $postUrl; ?>&title=<?php echo the_title(); ?>" title="Share on LinkedIn"><img src="https://livinghisword.org/wp-content/uploads/2020/03/linkedin.png" alt="linkedin" class="ShareBTN"></a> <a target="_blank" href="https://pinterest.com/pin/create/button/?url=<?php echo $postUrl; ?>&title=<?php echo the_title(); ?>" title="Share on pinterest"><img src="https://livinghisword.org/wp-content/uploads/2020/03/pinterest.png" alt="pinterest" class="ShareBTN"></a> <!-- LikeBtn.com BEGIN --> <span id="likeBUTTON" class="likebtn-wrapper" data-theme="custom" data-btn_size="70" data-f_size="18" data-icon_size="0" data-icon_l_url="https://livinghisword.org/wp-content/uploads/2020/11/heart-iconmonstr-64.png" data-icon_l_url_v="https://livinghisword.org/wp-content/uploads/2020/11/heart-after-iconmonstr-64.png" data-icon_d_url_v="https://livinghisword.org/wp-content/uploads/2020/11/heart-after-iconmonstr-64.png" data-label_c="#800000" data-label_c_v="#e07334" data-counter_l_c="#2a2a2a" data-bg_c="#ffffff" data-bg_c_v="#ffffff" data-brdr_c="#ffffff" data-label_fs="r" data-i18n_like="Like" data-white_label="true" data-rich_snippet="true" data-dislike_enabled="false" data-icon_dislike_show="false" data-voting_frequency="600" data-counter_clickable="true" data-counter_frmt="comma" data-popup_disabled="true" data-share_enabled="false" data-lazy_load="true" data-loader_show="true" data-i18n_after_like="Like" data-i18n_like_tooltip="Liked This Teaching!" data-i18n_unlike_tooltip="Thank you for sharing!" data-i18n_share_text="Thank you for liking this teaching please close this box."></span> <script>(function(d,e,s){if(d.getElementById("likebtn_wjs"))return;a=d.createElement(e);m=d.getElementsByTagName(e)[0];a.async=1;a.id="likebtn_wjs";a.src=s;m.parentNode.insertBefore(a, m)})(document,"script","//w.likebtn.com/js/w/widget.js");</script> <!-- LikeBtn.com END --> </div> </section>
What yours looks like
https://livinghisword.org/wp-content/uploads/2020/11/wpshowpost1.pngI would like to add my own instead of yours, please
https://livinghisword.org/wp-content/uploads/2020/12/wpshowpost.pngThank you for your time 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.