-
Author
Tagged: share this buttons
-
September 11, 2015 at 11:27 #77161TommasoParticipant
Hallo,
I would like to use the Share this buttons elsewhere in the home, not only in the post page.Please any advice?
Thank you.Regards
September 11, 2015 at 15:37 #77197RaduModeratorHi,
Add code to your function.php from kleo-child
COPY CODEadd_shortcode('custom_kleo_social_activity_share', 'custom_kleo_social_activity_share'); function custom_kleo_social_activity_share() { ?> <span class="kleo-social-activity-share <?php echo bp_get_activity_type(); ?>"> <a class="kleo-social-activity-share-item facebook" onclick="window.open(this.href,'Share','width=600,height=400'); return false;" href="https://www.facebook.com/sharer/sharer.php?t=<?php echo bp_get_activity_feed_item_title(); ?>&u=<?php echo bp_get_activity_thread_permalink(); ?>"><i class="icon-facebook"></i></a> <a class="kleo-social-activity-share-item twitter" onclick="window.open(this.href,'Share','width=600,height=400'); return false;" href="http://twitter.com/share?text=<?php echo bp_get_activity_feed_item_title(); ?>&url=<?php echo bp_get_activity_thread_permalink(); ?>"><i class="icon-twitter"></i></a> <a class="kleo-social-activity-share-item google" onclick="window.open(this.href,'Share','width=600,height=400'); return false;" href="https://plus.google.com/share?url=<?php echo bp_get_activity_thread_permalink(); ?>"><i class="icon-gplus"></i></a> <a class="kleo-social-activity-share-item mail" href="mailto:?body=<?php echo bp_get_activity_feed_item_title(); ?> <?php echo bp_get_activity_thread_permalink(); ?>"><i class="icon-mail"></i></a> </span> <?php }
Then use this code [custom_kleo_social_activity_share] where you want to icons to appear.
Best Regards
RAdu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 11, 2015 at 18:02 #77216TommasoParticipantHallo Radu,
there is some error in this code. Admin gets white page.Thank you!
September 12, 2015 at 21:29 #77340RaduModeratorHi,
Replace the code from above with this
COPY CODEadd_shortcode('custom_kleo_social_activity_share', 'custom_kleo_social_activity_share'); function custom_kleo_social_activity_share() { ?> <span class="kleo-social-activity-share <?php echo bp_get_activity_type(); ?>"> <a class="kleo-social-activity-share-item facebook" onclick="window.open(this.href,'Share','width=600,height=400'); return false;" href="https://www.facebook.com/sharer/sharer.php?t=<?php echo bp_get_activity_feed_item_title(); ?>&u=<?php echo bp_get_activity_thread_permalink(); ?>"><i class="icon-facebook"></i></a> <a class="kleo-social-activity-share-item twitter" onclick="window.open(this.href,'Share','width=600,height=400'); return false;" href="http://twitter.com/share?text=<?php echo bp_get_activity_feed_item_title(); ?>&url=<?php echo bp_get_activity_thread_permalink(); ?>"><i class="icon-twitter"></i></a> <a class="kleo-social-activity-share-item google" onclick="window.open(this.href,'Share','width=600,height=400'); return false;" href="https://plus.google.com/share?url=<?php echo bp_get_activity_thread_permalink(); ?>"><i class="icon-gplus"></i></a> </span> <?php }
Then use this code [custom_kleo_social_activity_share] where you want to icons to appear.
Let me know if it works.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 14, 2015 at 09:59 #77498TommasoParticipantHallo Radu,
I am sorry but it doesn’t work. Admin gets blocked.Thank you.
September 14, 2015 at 16:50 #77538RaduModeratorHi,
Strange because on my local environment it doesn’t
Do you have other custom codes in your functions.php ?
If you can provide your functions file to test it before provide you solution it will be ok.
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 14, 2015 at 17:01 #77540TommasoParticipantHallo, here is the code in function.php. I just added the code you gave me.
Thank you
<?php
/**
* @package WordPress
* @subpackage Kleo
* @author SeventhQueen <themesupport@seventhqueen.com>
* @since Kleo 1.0
*//**
* Kleo Child Theme Functions
* Add custom code below
*/add_shortcode(‘custom_kleo_social_activity_share’, ‘custom_kleo_social_activity_share’);
function custom_kleo_social_activity_share() {
?>
<span class=”kleo-social-activity-share <?php echo bp_get_activity_type(); ?>”>
&u=< ?php echo bp_get_activity_thread_permalink(); ?>”><i class=”icon-facebook”></i>
&url=< ?php echo bp_get_activity_thread_permalink(); ?>”><i class=”icon-twitter”></i>
“><i class=”icon-gplus”></i>
</span>
< ?php
}September 14, 2015 at 17:54 #77563RaduModeratorTry the attached file and let me know.. it should work.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAttachments:
You must be logged in to view attached files.September 14, 2015 at 18:29 #77581TommasoParticipantHallo Radu,
thank you. Now it doesn’t seem to block admin area.
Unfortunately I tried to use it via Myshortcode of Visual Composer but site crashes. I tried to use it inside a widget but in this case there are problems too (css problems).It’s a pitty!
September 15, 2015 at 16:42 #77824RaduModeratorHi,
Please provide page where the shortcode appears with css problems
Try to use the shortcode in VC by adding it in a text block from VC
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 15, 2015 at 19:06 #77897TommasoParticipantHallo,
here is the link of the page with text block + [custom_kleo_social_activity_share]eliadiaco.it/angiologia/medicinavascolare/curriculum-professionale/
Thank you
September 16, 2015 at 15:36 #78011RaduModeratorHi,
I tested on my local environment and it works for me, no errors no blank pages.
Please enable debug https://codex.wordpress.org/WP_DEBUG#Usage to see what error appears.
Regards
RAdu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 16, 2015 at 17:18 #78036TommasoParticipantHallo,
I enabled debug mode and here is what debug log registered:[16-Sep-2015 14:23:19 UTC] PHP Fatal error: Call to undefined function bp_get_activity_type() in /home/elia/public_html/angiologia/medicinavascolare/wp-content/themes/kleo-child/functions.php on line 18
Thank you
September 17, 2015 at 14:43 #78192RaduModeratorHi,
Can you please provide ftp to investigate this issue ?
Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 17, 2015 at 18:49 #78226TommasoParticipantRadu,
please provide me a private mail.
thank youSeptember 18, 2015 at 17:50 #78373RaduModeratorHi,
Please respond here and mark the reply as private.
my email is : radu@seventhqueen.com but post here marked as private your reply with credentials
Best Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 21, 2015 at 18:51 #78755RaduModeratorPlease provide the website url.
Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 22, 2015 at 19:21 #78969RaduModeratorHi,
It’s done you can use this shortcode [custom_kleo_social_activity_share]
I used this function
COPY CODEadd_shortcode('custom_kleo_social_activity_share', 'add_kleo_social_share'); function add_kleo_social_share() { ?> <span class="kleo-facebook"> <a href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>" class="post_share_facebook" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=220,width=600');return false;"> <i class="icon-facebook"></i> </a> </span> <span class="kleo-twitter"> <a href="https://twitter.com/share?url=<?php the_permalink(); ?>" class="post_share_twitter" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=260,width=600');return false;"> <i class="icon-twitter"></i> </a> </span> <span class="kleo-googleplus"> <a href="https://plus.google.com/share?url=<?php the_permalink(); ?>" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"> <i class="icon-gplus"></i> </a> </span> <span class="kleo-mail"> <a href="mailto:?subject=<?php echo strip_tags(get_the_title()); ?>&body=<?php the_permalink(); ?>" class="post_share_email"> <i class="icon-mail"></i> </a> </span> <?php }
Best Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 22, 2015 at 20:07 #78992TommasoParticipantHallo Radu,
thank you for patience but other problems have come out with it.I think I’d better give up.
Thank you.
RegardsOctober 16, 2015 at 13:46 #82666TommasoParticipantHallo Radu,
after solving other problems I decided to eventually add this shortcode requested by my client.
I copied the above code in funcion.php but the site gets blocked once again.You know, via private access you made this mod, that I cancelled to see if some social share errors where caused by it.
Now I am proceeding as you did but it desn’t work.Thank you for your patience.
RegardsOctober 16, 2015 at 19:16 #82735RaduModeratorHi,
Try to test with this function instead.
COPY CODEadd_shortcode('custom_kleo_social_activity_share', 'custom_kleo_social_activity_share'); function custom_kleo_social_activity_share() { ?> <span class="kleo-social-activity-share <?php echo bp_get_activity_type(); ?>"> <a class="kleo-social-activity-share-item facebook" onclick="window.open(this.href,'Share','width=600,height=400'); return false;" href="https://www.facebook.com/sharer/sharer.php?t=<?php echo bp_get_activity_feed_item_title(); ?>&u=<?php echo bp_get_activity_thread_permalink(); ?>"><i class="icon-facebook"></i></a> <a class="kleo-social-activity-share-item twitter" onclick="window.open(this.href,'Share','width=600,height=400'); return false;" href="http://twitter.com/share?text=<?php echo bp_get_activity_feed_item_title(); ?>&url=<?php echo bp_get_activity_thread_permalink(); ?>"><i class="icon-twitter"></i></a> <a class="kleo-social-activity-share-item google" onclick="window.open(this.href,'Share','width=600,height=400'); return false;" href="https://plus.google.com/share?url=<?php echo bp_get_activity_thread_permalink(); ?>"><i class="icon-gplus"></i></a> </span> <?php }
Then add this shortcode where you want to show
[custom_kleo_social_activity_share]
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 19, 2015 at 17:06 #83172RaduModeratorHi,
Can you please provide the wp admin and ftp credentials please?
Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 21, 2015 at 16:51 #83547RaduModeratorHi,
Please provide me correct FTP details.
I meanwhile of implementation/debugging I’ve need to use exit function in kleo child, now the site will show blank page, provide me correct ftp details to fix this.
Sorry for inconvenience.
Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 21, 2015 at 16:54 #83548RaduModeratorHi,
I’ve logged in successfully now, i will let you know regarding the social share icons.
Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 21, 2015 at 17:30 #83550RaduModeratorHi,
Take a look at this page http://www.eliadiaco.it/angiologia/medicinavascolare/test-shortcode-share-icons/
The shortcode is running
Use this shortcode [socialshareicons]
Let me know if si ok.
Regards
RAdu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 22, 2015 at 13:17 #83701RaduModeratorYou’re welcome,
Also don’t forget to rate our theme on Themeforest and give it 5 stars 🙂
http://themeforest.net/downloads/
Best regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.