This topic has 40 replies, 3 voices, and was last updated 8 years by joy.

  • Author
  • #77161
     Tommaso
    Participant

    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

    #77197
     Radu
    Moderator

    Hi,

    Add code to your function.php from kleo-child

    COPY CODE
    
    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(); ?>">
            <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 solution
    #77216
     Tommaso
    Participant

    Hallo Radu,
    there is some error in this code. Admin gets white page.

    Thank you!

    #77340
     Radu
    Moderator

    Hi,

    Replace the code from above with this

    COPY CODE
    
    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(); ?>">
            <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 solution
    #77498
     Tommaso
    Participant

    Hallo Radu,
    I am sorry but it doesn’t work. Admin gets blocked.

    Thank you.

    #77538
     Radu
    Moderator

    Hi,

    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 solution
    #77540
     Tommaso
    Participant

    Hallo, 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
    }

    #77563
     Radu
    Moderator

    Try 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 solution
    Attachments:
    You must be logged in to view attached files.
    #77581
     Tommaso
    Participant

    Hallo 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!

    #77824
     Radu
    Moderator

    Hi,

    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 solution
    #77897
     Tommaso
    Participant

    Hallo,
    here is the link of the page with text block + [custom_kleo_social_activity_share]

    eliadiaco.it/angiologia/medicinavascolare/curriculum-professionale/

    Thank you

    #78011
     Radu
    Moderator

    Hi,

    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 solution
    #78036
     Tommaso
    Participant

    Hallo,
    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

    #78192
     Radu
    Moderator

    Hi,

    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 solution
    #78226
     Tommaso
    Participant

    Radu,
    please provide me a private mail.
    thank you

    #78373
     Radu
    Moderator

    Hi,

    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 solution
    #78427
     Tommaso
    Participant
    This reply has been set as private.
    #78755
     Radu
    Moderator

    Please 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 solution
    #78756
     Tommaso
    Participant
    This reply has been set as private.
    #78757
     Radu
    Moderator
    This reply has been set as private.
    #78759
     Tommaso
    Participant
    This reply has been set as private.
    #78760
     Tommaso
    Participant
    This reply has been set as private.
    #78761
     Radu
    Moderator
    This reply has been set as private.
    #78763
     Tommaso
    Participant
    This reply has been set as private.
    #78767
     Radu
    Moderator
    This reply has been set as private.
    #78769
     Tommaso
    Participant
    This reply has been set as private.
    #78969
     Radu
    Moderator

    Hi,

    It’s done you can use this shortcode [custom_kleo_social_activity_share]

    I used this function

    COPY CODE
    
    add_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 solution
    #78992
     Tommaso
    Participant

    Hallo Radu,
    thank you for patience but other problems have come out with it.

    I think I’d better give up.

    Thank you.
    Regards

    #82666
     Tommaso
    Participant

    Hallo 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.
    Regards

    #82735
     Radu
    Moderator

    Hi,

    Try to test with this function instead.

    COPY CODE
    
    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(); ?>">
            <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 solution
    #82744
     Tommaso
    Participant

    Hallo Radu,
    site gets blocked too.

    I am sorry

    #83172
     Radu
    Moderator

    Hi,

    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 solution
    #83194
     Tommaso
    Participant
    This reply has been set as private.
    #83547
     Radu
    Moderator

    Hi,

    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 solution
    #83548
     Radu
    Moderator

    Hi,

    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 solution
    #83550
     Radu
    Moderator

    Hi,

    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 solution
    #83586
     Tommaso
    Participant

    Great Radu,

    thank you !

    Regards

    #83701
     Radu
    Moderator

    You’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
    #83863
     Tommaso
    Participant

    Done!

    #92541
     joy
    Participant

    Hello, can you please share the final function and shortcode to get this to work? Thank you.

Viewing 40 posts - 1 through 40 (of 41 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?