Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #703193

    PierreMeul
    Participant

    I am not sure what is happening nor what I should check.

    This button is selected from the Portfolio options to show and it shows up at bottom of the page but when I click, I only see the mailto:?subject…and the message but nothing happen…

    #703512

    Friech
    Moderator

    Hi There,

    Thanks for writing in! The mailto link should open the default email application (outlook, thunderbird, etc.) of your machine. You can also set up your browser to be the default email application with a Gmail account.

    http://blog.hubspot.com/marketing/set-gmail-as-browser-default-email-client-ht

    Hope it helps, Cheers!

    #703804

    PierreMeul
    Participant

    Re-tested and it is working now. Not sure what happened yesterday.

    #703816

    Rue Nel
    Moderator

    Hey There,

    It is good to know that it is working now.
    If you need anything else we can help you with, don’t hesitate to open another thread.

    Best Regards,
    X

    #703827

    PierreMeul
    Participant

    I now tested but it failed… this code from another post of this forum to allow me to chnage the text of the Share via email button. The result is that all my site goes blank. I am not sure what I should chnaged.

    I just put this code in my x-child theme in the functions.php and boum… all blank pages, cannot have my site displayed anymore. There must be something with his code: I am unsure why the initial code had no carriage return on the next line for some lines while I have the lines like this below… does it matter?

    function custom_shortcode_entry_share( $atts ) {
    extract( shortcode_atts( array(
    ‘id’ => ”,
    ‘class’ => ”,
    ‘style’ => ”,
    ‘title’ => ”,
    ‘facebook’ => ”,
    ‘twitter’ => ”,
    ‘google_plus’ => ”,
    ‘linkedin’ => ”,
    ‘pinterest’ => ”,
    ‘reddit’ => ”,
    ’email’ => ”
    ), $atts ) );

    $share_url = urlencode( get_permalink() );
    $share_title = urlencode( get_the_title() );
    $share_source = urlencode( get_bloginfo( ‘name’ ) );
    $share_content = urlencode( get_the_excerpt() );
    $share_media_info = wp_get_attachment_image_src( get_post_thumbnail_id(), ‘full’ );
    $share_media = $share_media_info[0];

    $id = ( $id != ” ) ? ‘id=”‘ . esc_attr( $id ) . ‘”‘ : ”;
    $class = ( $class != ” ) ? ‘x-entry-share ‘ . esc_attr( $class ) : ‘x-entry-share’;
    $style = ( $style != ” ) ? ‘style=”‘ . $style . ‘”‘ : ”;
    $title = ( $title != ” ) ? $title : __( ‘Share this Post’, ‘__x__’ );
    $facebook = ( $facebook == ‘true’ ) ? “<i class=\”x-icon-facebook-square\”></i>” : ”;
    $twitter = ( $twitter == ‘true’ ) ? “<i class=\”x-icon-twitter-square\”></i>” : ”;
    $google_plus = ( $google_plus == ‘true’ ) ? “<i class=\”x-icon-google-plus-square\”></i>” : ”;
    $linkedin = ( $linkedin == ‘true’ ) ? “<i class=\”x-icon-linkedin-square\”></i>” : ”;
    $pinterest = ( $pinterest == ‘true’ ) ? “<i class=\”x-icon-pinterest-square\”></i>” : ”;
    $reddit = ( $reddit == ‘true’ ) ? “<i class=\”x-icon-reddit-square\”></i>” : ”;
    $email = ( $email == ‘true’ ) ? “<span><i class=\”x-icon-envelope-square\”></i></span>” : ”;

    $output = “<div {$id} class=\”{$class}\” {$style}>”
    . ‘<p>’ . $title . ‘</p>’
    . ‘<div class=”x-share-options”>’
    . $facebook . $twitter . $google_plus . $linkedin . $pinterest . $reddit . $email
    . ‘</div>’
    . ‘</div>’;

    return $output;
    }

    add_filter(‘init’, ‘custom_entry_share’);

    function custom_entry_share() {
    remove_shortcode( ‘share’ );
    add_shortcode( ‘share’, ‘custom_shortcode_entry_share’ );
    }

    #703857

    Thai
    Moderator

    Hi There,

    Please try with this code instead:

    function custom_shortcode_entry_share( $atts ) {
      extract( shortcode_atts( array(
      'id'          => '',
      'class'       => '',
      'style'       => '',
      'title'       => '',
      'facebook'    => '',
      'twitter'     => '',
      'google_plus' => '',
      'linkedin'    => '',
      'pinterest'   => '',
      'reddit'      => '',
      'email'       => ''
      ), $atts ) );
    
      $share_url        = urlencode( get_permalink() );
      $share_title      = urlencode( get_the_title() );
      $share_source     = urlencode( get_bloginfo( 'name' ) );
      $share_content    = urlencode( get_the_excerpt() );
      $share_media_info = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
      $share_media      = $share_media_info[0];
    
      $id          = ( $id != '' ) ? 'id="' . esc_attr( $id ) . '"' : '';
      $class       = ( $class != '' ) ? 'x-entry-share ' . esc_attr( $class ) : 'x-entry-share';
      $style       = ( $style != '' ) ? 'style="' . $style . '"' : '';
      $title       = ( $title != '' ) ? $title : __( 'Share this Post', '__x__' );
      $facebook    = ( $facebook == 'true' ) ? "<i class=\"x-icon-facebook-square\"></i>" : '';
      $twitter     = ( $twitter == 'true' ) ? "<i class=\"x-icon-twitter-square\"></i>" : '';
      $google_plus = ( $google_plus == 'true' ) ? "<i class=\"x-icon-google-plus-square\"></i>" : '';
      $linkedin    = ( $linkedin == 'true' ) ? "<i class=\"x-icon-linkedin-square\"></i>" : '';
      $pinterest   = ( $pinterest == 'true' ) ? "<i class=\"x-icon-pinterest-square\"></i>" : '';
      $reddit      = ( $reddit == 'true' ) ? "<i class=\"x-icon-reddit-square\"></i>" : '';
      $email       = ( $email == 'true' ) ? "<span><i class=\"x-icon-envelope-square\"></i></span>" : '';
    
      $output = "<div {$id} class=\"{$class}\" {$style}>"
      . '<p>' . $title . '</p>'
      . '<div class="x-share-options">'
      . $facebook . $twitter . $google_plus . $linkedin . $pinterest . $reddit . $email
      . '</div>'
      . '</div>';
    
      return $output;
    }
    
    add_action('init', 'custom_entry_share');
    
    function custom_entry_share() {
      remove_shortcode( 'share' );
      add_shortcode( 'share', 'custom_shortcode_entry_share' );
    }

    The shortcode: [share twitter="true" facebook="true" email="true"]

    Let us know how it goes!

    #704094

    PierreMeul
    Participant

    That code works OK but how do I go with changing the text of the Share via Email button that says “Hey, …” ?

    #704121

    Thai
    Moderator

    Hi There,

    You can try with this shortcode:

    [share twitter="true" facebook="true" email="true" email_subject="Your new email subject will go here"]

    Hope it helps 🙂

    #704127

    PierreMeul
    Participant

    I am unsure where I would have to put that shortcode… The idea is to have all my portfolio pages reflecting this.
    Also how would I do with changing the label of the social icon?

    #704377

    Rue Nel
    Moderator

    Hello There,

    Sorry for the confusion. To change text of the Share via Email button that says “Hey, thought you might enjoy this! Check it out when you have a chance”, since you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.

    function change_email_subject($translated) { 
      $your_text  = "insert your translation here";
      $translated = str_ireplace('Hey, thought you might enjoy this! Check it out when you have a chance:', $your_text, $translated);
      return $translated; 
    }
    add_filter('gettext', 'change_email_subject' );

    Please let us know if this works out for you.

    #704594

    PierreMeul
    Participant

    Yes, this code works. Thank you.

    #704605

    Christopher
    Moderator

    You’re welcome.

    #704615

    PierreMeul
    Participant

    How do I go now with changing the text of the Social buttons on each of the portfolio pages?

    I mean, today when you hover on these it says something like “Share via …” and I’d like to see it in French like “Partager via …”

    #704626

    Christopher
    Moderator

    Hi there,

    Please translate strings in x.pot file.
    Please check this link : https://community.theme.co/kb/translation/

    Thanks.

    #704643

    PierreMeul
    Participant

    Thank you for this link. I may consider this process once I have more time.

    I have a x-child theme set already, wouldn’t you have a few lines of code to just change that?