Viewing 30 results - 31 through 60 (of 103 total)
  • Author
    Search Results
  • #1192594

    Hi David,

    I have updated the function you have for Whatsapp sharing as well

    //Add items on the social share section
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    	$args['whatsapp_icon'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://whatsapp.com/share?text=[title]&url=[permalink]", 'label' => __("Compartir en Whatsapp",'avia_framework'));
    	return $args;
    }

    Please flush browser cache and review your website :)

    Best regards,
    Yigit

    #1191871
    david_peris
    Participant

    Hi,

    My share button on whatsapp stopped working.
    I have solved it by adding this code in functions.php:

    // Register new icon as a theme icon
    add_filter('avf_default_icons','avia_add_custom_icon', 10, 1);
    function avia_add_custom_icon($icons) {
    	$icons['whatsapp']	 = array( 'font' =>'whatsapp-font-icon', 'icon' => 'ue800');
    	return $icons;
    }
    
    //Adjust icons
    add_filter('avia_filter_social_icons', 'avia_filter_social_icons_mod', 10, 1);
    function avia_filter_social_icons_mod($icons) {
    	$icons['Whatsapp'] = 'whatsapp';
    	return $icons;
    }
    
    //Add items on the social share section
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    	$args['whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://whatsapp.com/share?text=[title]&url=[permalink]", 'label' => __("Share on Whatsapp",'avia_framework'));
    	return $args;
    }

    and css:

    .social_bookmarks_whatsapp a::before, .av-social-link-whatsapp a::before {
    font-family: 'entypo-fontello';
    content: '';
    }

    But the icon does not show correctly. Attachment screenshot:
    whatsapp icon missing

    I need it to be displayed correctly. Can you help me?
    Thanks!
    David

    #1181670

    In reply to: FB sharing button

    Hi Anton,

    I’m not very familiar with via in facebook but if you want to add it in the url, you can do that, you can use this code (combined with your twitter sharing code above):

    function avia_add_social_share_link_arguments($args) {
      $args['twitter'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[shortlink]&via=Anton_Malafeev"); 
      $args['facebook'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://www.facebook.com/sharer.php?u=[permalink]&t=[title]"); 
      return $args;
    }
    
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);

    Best regards,
    Nikko

    #1180712

    Topic: FB sharing button

    in forum Enfold
    Anton
    Participant

    Hi guys,

    some time ago you gave me the following code to insert “via @…” for Twitter sharing:

    /*TWITTER SHARING CUSTOMIZATION*/
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {$args['twitter'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[shortlink]&via=Anton_Malafeev"); return $args;}

    Is that possible to add the same “via @…” to the Facebook share button ? I’d like to make people sharing via one of my FB pages.

    Cheers,

    #1177808

    Hi Yiigit
    As I wrote you before
    I was using two functions to share on telegram in Social Share Buttons
    they worked also in 4.7.1, but after upgrading to 4.7.2 the Telegram button disappeared.

    Functions:
    // Register new icon as a theme icon
    add_filter(‘avf_default_icons’,’avia_add_custom_icon’, 10, 1);
    function avia_add_custom_icon($icons) {
    $icons[‘telegram’] = array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8b7’);
    return $icons;
    }

    //Add items on the social share section
    add_filter(‘avia_social_share_link_arguments’, ‘avia_add_social_share_link_arguments’, 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    $args[‘telegram’] = array(“encode”=>true, “encode_urls”=>false, “pattern” => “https://telegram.me/share/url?text=&url=[permalink]”, ‘label’ => __(“Share on Telegram”,’avia_framework’));
    return $args;
    }

    Can you help me to restore the Telegram button please?

    Thank you
    Manu

    #1177794
    manurimini
    Participant

    Hi
    I was using two functions to share on telegram in Social Share Buttons
    they worked also in 4.7.1, but after upgrading to 4.7.2 the Telegram button disappeared.

    Functions:
    // Register new icon as a theme icon
    add_filter(‘avf_default_icons’,’avia_add_custom_icon’, 10, 1);
    function avia_add_custom_icon($icons) {
    $icons[‘telegram’] = array( ‘font’ =>’entypo-fontello’, ‘icon’ => ‘ue8b7’);
    return $icons;
    }

    //Add items on the social share section
    add_filter(‘avia_social_share_link_arguments’, ‘avia_add_social_share_link_arguments’, 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    $args[‘telegram’] = array(“encode”=>true, “encode_urls”=>false, “pattern” => “https://telegram.me/share/url?text=&url=[permalink]”, ‘label’ => __(“Share on Telegram”,’avia_framework’));
    return $args;
    }

    Can you help me to restore the Telegram button please?

    Thank you
    Manu

    • This topic was modified 5 years, 11 months ago by manurimini.
    #1175335

    Hi Yigit
    I figured out what was causing the Warning on helper-social-media.php on line 370 – if( ‘yelp’ == $icon[‘social_icon’] ) –
    But I don’t know how to solve it. Please help me.
    I use three functions to add Telegram to the Social Share Buttons
    1 – // Register new icon as a theme icon
    add_filter(‘avf_default_icons’,’avia_add_custom_icon’, 10, 1);
    //Adjust icons
    add_filter(‘avia_filter_social_icons’, ‘avia_filter_social_icons_mod’, 10, 1);
    3 – //Add items on the social share section
    add_filter(‘avia_social_share_link_arguments’, ‘avia_add_social_share_link_arguments’, 10, 1);

    The one causing the Warning is:
    //Adjust icons
    add_filter(‘avia_filter_social_icons’, ‘avia_filter_social_icons_mod’, 10, 1);
    function avia_filter_social_icons_mod($icons) {
    $icons[‘Telegram’] = ‘telegram’;
    return $icons;
    }

    Can you help me to fix the issue?

    • This reply was modified 5 years, 12 months ago by manurimini.
    milionplus
    Participant

    Hi,

    I could not find solution for adding custom share link. I need to add messenger icon and FB url with send argument. I found on forum this one
    /*
    * Add items on the social share section
    */

    add_filter(‘avia_social_share_link_arguments’, ‘avia_add_social_share_link_arguments’, 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    $args[‘Messenger’] = array(“encode”=>true, “encode_urls”=>false, “pattern” => “https://www.facebook.com/dialog/send?app_id=2110525345925438&link=[permalink]&redirect_uri=[permalink]”);
    return $args;
    }

    But this is not exactly what i am looking for

    How can i add custom share link with custom URL adress and also custom icon image?

    Jakub

    #1110260

    Hi OlonamZaid, Jarmo and Enfold Team
    If you want to share a post or page on Whatsapp you have to change the line
    $args['Whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://whatsapp.com/share?text=[title]&url=[permalink]");
    into
    $args['whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://api.whatsapp.com/send?text=[permalink]", 'label' => __("Share on Whatsapp",'avia_framework'));
    otherwise like you reported the link will open up the whatsapp core website.
    It works for me. Tested on several devices, but I’m only a graphic designer not a programmer. Hope this will help.
    Best Regards

    Here the code I use (functions.php in child theme)

    // Register new icon as a theme icon
    add_filter('avf_default_icons','avia_add_custom_icon', 10, 1);
    function avia_add_custom_icon($icons) {
    	$icons['whatsapp']	 = array( 'font' =>'rockets', 'icon' => 'uf232');
    	return $icons;
    }
    
    //Adjust icons
    add_filter('avia_filter_social_icons', 'avia_filter_social_icons_mod', 10, 1);
    function avia_filter_social_icons_mod($icons) {
    	$icons['Whatsapp'] = 'whatsapp';
    	return $icons;
    }
    
    //Add items on the social share section
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    	$args['whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://api.whatsapp.com/send?text=[permalink]", 'label' => __("Share on Whatsapp",'avia_framework'));
    	return $args;
    }

    Pay attention to put the right icon with the font-family you are using: array( ‘font’ =>’font-family‘, ‘icon’ => ‘the one you choose‘);

    • This reply was modified 6 years, 7 months ago by manurimini.
    #1107427

    Hi allaith!

    This is the code i use now and which is working.
    All the whatsapp relevant parts

    // Register new icon as a theme icon
    add_filter('avf_default_icons','avia_add_custom_icon', 10, 1);
    function avia_add_custom_icon($icons) {
    	$icons['whatsapp']	 = array( 'font' =>'whatsapp-font-icon', 'icon' => 'ue800');
    	return $icons;
    }
    
    //Adjust icons
    add_filter('avia_filter_social_icons', 'avia_filter_social_icons_mod', 10, 1);
    function avia_filter_social_icons_mod($icons) {
    	$icons['Whatsapp'] = 'whatsapp';
    	return $icons;
    }
    
    // set whatsapp url pattern
    add_filter('avia_social_share_link_arguments', 'avia_social_share_link_arguments_mod', 10, 1);
    function avia_social_share_link_arguments_mod($args)
    {
        $pattern = 'https://web.whatsapp.com/send?text=[permalink]';
    
        if ( wp_is_mobile() ) {
            $pattern = 'whatsapp://send?text=[permalink]';
        } 
    
    	$args['whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => $pattern, 'label' => __("Deel via WhatsApp",'avia_framework'));
    	return $args;
    }
    
    function custom_add_more_protocols( $protocols ){
    	$protocols[] = 'whatsapp';
    	return $protocols;
    }
    add_filter( 'kses_allowed_protocols' , 'custom_add_more_protocols' );

    And use this in quick-css to style the whatsapp button.

    /* Whatsapp button color */
    #top #wrap_all .av-social-link-whatsapp:hover a {
    color: #ffffff;
    background-color: #3bb528;
    }
    #1105318

    Hi,

    Thank you for the update.

    You can use the wp_is_mobile function to load the appropriate URL pattern for desktop and mobile device.

    // set whatsapp url pattern
    add_filter('avia_social_share_link_arguments', 'avia_social_share_link_arguments_mod', 10, 1);
    function avia_social_share_link_arguments_mod($args)
    {
        $pattern = 'https://web.whatsapp.com/send?text=[permalink]';
    
        if ( wp_is_mobile() ) {
            $pattern = 'whatsapp://send?text=[permalink]';
        } 
    
    	$args['whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => $pattern, 'label' => __("Deel via WhatsApp",'avia_framework'));
    	return $args;
    }

    Best regards,
    Ismael

    #1104527

    but is only working on mob if it must work on desktop the code has to be:

    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    	$args['whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://web.whatsapp.com/send?text=[permalink]", 'label' => __("Deel via WhatsApp",'avia_framework'));
    	return $args;
    }

    Is there a way to combine this?

    #1104522

    Hey chrishilli,

    This worked for me:

    /*Add items on the social share section*/
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    	$args['whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "whatsapp://send?text=[permalink]", 'label' => __("Deel via WhatsApp",'avia_framework'));
    	return $args;
    }

    Hi,

    Thank you for using Enfold.

    As far as I see only twitter is using this “shortlink”.

    In functions.php of your child theme (or parent theme) add:

    
    function my_social_share_link_arguments( array $args )
    {
    	$args['twitter'] = array( "encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[permalink]" );
    	
    	return $args;
    }
    
    add_filter( 'avia_social_share_link_arguments', 'my_social_share_link_arguments', 10, 1 );
    

    If you encounter others let us know please.

    Best regards,
    Günter

    #1099238
    Arcatech
    Participant

    Hello There,
    I successfully added in the past a whatsapp share button as suggested in this forum with the following function in functin.php

    
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args) {
    $args['whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "whatsapp://send?[title]&url=[permalink]", 'label' => __("Condividi su Whatsapp",'avia_framework'));
    return $args;}

    After the last WP update to 5.2. suddenly the whatsapp links stopped working. The outout is empty.

    Is this caused by wordpress or Enfold needs an update too? Do you have any idea how to solve this?
    Thanks

    #1095307
    chrishilli
    Participant

    Hello!

    The Whatsapp button in the social share blog posts stopped working.
    It now opens a new page instead of sharing to whatsapp.

    My functions.php from the child theme is:

    <?php
    
    /*
    * Add your own functions here. You can also copy some of the theme functions into this file. 
    * WordPress will use those functions instead of the original functions then.
    */
    
    // Register new icon as a theme icon
    add_filter('avf_default_icons','avia_add_custom_icon', 10, 1);
    function avia_add_custom_icon($icons) {
    	$icons['whatsapp']	 = array( 'font' =>'whatsapp-font-icon', 'icon' => 'ue800');
    	return $icons;
    }
    
    //Adjust icons
    add_filter('avia_filter_social_icons', 'avia_filter_social_icons_mod', 10, 1);
    function avia_filter_social_icons_mod($icons) {
    	$icons['Whatsapp'] = 'whatsapp';
    	return $icons;
    }
    
    //Add items on the social share section
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    	$args['whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "whatsapp://send?text=[title]&url=[permalink]", 'label' => __("Auf Whatsapp teilen",'avia_framework'));
    	return $args;
    }

    Regards

    Chris

    Hi mkammes,

    Can you try adding this php code in functions.php:

    function avia_add_social_share_link_arguments($args) {
    	$args['twitter']['pattern'] = 'https://twitter.com/share?text=[title]&url=[permalink]';
    	return $args;
    }
    
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);

    Hope it helps.

    Best regards,
    Nikko

    #1046554
    ngb-AndreKoppies
    Participant

    Hi,

    This is an update for this thread:https://kriesi.at/support/topic/add-whatsapp-icon/#post-532969
    In there there is a solution for adding the WhatsApp icon to the header social follow items and to the social sharing icons.
    2 things didn’t work for me.
    1. The link whatsapp://send?text=[title]-[permalink] doesn’t work on desktop. When I changed it to https://api.whatsapp.com/send?text=[title]-[permalink&#93; it works on mobile and desktop also.
    2. When you add the CSS markup to the Quick CSS section the styling is not being handled. When you add !important to both CSS styles it does work.

    // Register new icon as a theme icon
    function avia_add_custom_icon($icons) {
    	$icons['whatsapp']	 = array( 'font' =>'whatsapp-font-icon', 'icon' => 'ue800');
    	return $icons;
    }
    add_filter('avf_default_icons','avia_add_custom_icon', 10, 1);
    
    // Add new icon as an option for social icons
    function avia_add_custom_social_icon($icons) {
    	$icons['Whatsapp'] = 'whatsapp';
    	return $icons;
    }
    add_filter('avf_social_icons_options','avia_add_custom_social_icon', 10, 1);
    
    //Add items on the social share section
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    	$new_array = array(
    		'whatsapp' => array(
    			"encode"=>true, "encode_urls"=>false, "pattern" => "https://api.whatsapp.com/send?text=[title]-[permalink]"
    		)
    	);
    
    	return array_merge($new_array, $args);
    }

    3. If you don’t have a child theme functions.php, install this plugin
    and add the code from step 2 into the functions.php added by the plugin.
    4. Add this to your Quick CSS to change the whatsapp-button color.

    /* Whatsapp button color */
    #top #wrap_all .av-social-link-whatsapp:hover a {
    color: #fff !important;
    background-color: #3bb528 !important;
    }

    Hope this helps.

    #1034393

    Hi,

    That is the default pattern of the twitter share button. The url parameter contains the shortlink instead of the post permalink. You can change that with the “avia_social_share_link_arguments” filter.

    Example:

    
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
        $permalink = get_the_permalink(get_the_ID());
        $args['twitter']['pattern'] = 'https://twitter.com/share?text=[title]&url=' . $permalink;
        return $args;
    }

    Best regards,
    Ismael

    #1019788

    Hi,

    You can use the “avia_social_share_link_arguments” filter to adjust the default social parameters including the pattern.

    Example:

    // https://kriesi.at/support/topic/whatsapp-button-in-share-box/#post-938674
    // https://kriesi.at/support/topic/how-to-get-twitter-social-share-element-to-display-summary-with-large-image/#post-987821

    Best regards,
    Ismael

    Hi,

    Yes, that’s what it does. I think the card is not displaying because the og:url is supposed to be the same as the shared link in the tweet. Add this filter in the functions.php file to change the twitter pattern.

    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
        $permalink = get_the_permalink(get_the_ID());
    	$args['twitter']['pattern'] = 'https://twitter.com/share?text=[title]&url=' . $permalink;
    	return $args;
    }

    Or maybe that’s how it’s supposed to work — twitter cards will only display on the actual feed, not when tweeting.

    Best regards,
    Ismael

    #978478
    hardyfinch
    Participant

    Hi,

    I’ve been through various updates but none seem to work for me, I have uploaded the fontella zip file and added the following code to functionality plugin but WhatsApp doesnt appear in the list on Enfold –> Social Profiles. Can someone point me in the right direction

    function avia_add_custom_icon($icons) {
    $icons[‘whatsapp’]	= array( ‘font’ =>’whatsapp-font-icon’, ‘icon’ => ‘ue800’);
    return $icons;
    }
    add_filter(‘avf_default_icons’,’avia_add_custom_icon’, 10, 1);
    
    // Add new icon as an option for social icons
    function avia_add_custom_social_icon($icons) {
    $icons[‘Whatsapp’] = ‘whatsapp’;
    return $icons;
    }
    add_filter(‘avf_social_icons_options’,’avia_add_custom_social_icon’, 10, 1);
    
    //Add items on the social share section
    add_filter(‘avia_social_share_link_arguments’, ‘avia_add_social_share_link_arguments’, 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    $new_array = array(
    ‘whatsapp’ => array(
    “encode”=>true, “encode_urls”=>false, “pattern” => “whatsapp://send?text=[title]-[permalink]”
    )
    );
    
    return array_merge($new_array, $args);
    }

    many thanks

    #962718
    cocoagroup
    Participant

    Hello guys! I love your theme!

    I’m trying to add a WhatsApp icon to my website’s header, I have followed these steps: https://kriesi.at/support/topic/insert-code-above-in-social-links/

    I’ve already imported the fontello.zip files and added this to the Child Theme’s function.php file:

    function avia_add_custom_icon($icons) {
    $icons[‘whatsapp’] = array( ‘font’ =>’whatsapp-font-icon’, ‘icon’ => ‘ue800’);
    return $icons;
    }
    add_filter(‘avf_default_icons’,’avia_add_custom_icon’, 10, 1);

    // Add new icon as an option for social icons
    function avia_add_custom_social_icon($icons) {
    $icons[‘Whatsapp’] = ‘whatsapp’;
    return $icons;
    }
    add_filter(‘avf_social_icons_options’,’avia_add_custom_social_icon’, 10, 1);

    //Add items on the social share section
    add_filter(‘avia_social_share_link_arguments’, ‘avia_add_social_share_link_arguments’, 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    $new_array = array(
    ‘whatsapp’ => array(
    “encode”=>true, “encode_urls”=>false, “pattern” => “whatsapp://send?text=[title]-[permalink]”
    )
    );

    return array_merge($new_array, $args);
    }

    It is not woking . Can you please help me? I’m providing you an admin access on private content section.
    Also, I will need to add a Trip Advisor icon later.
    Thank you!

    Hi,

    Have you tried using the “avia_social_share_link_arguments” filter? It can be found inside the includes > helper-social-media.php file. Example:

    // https://kriesi.at/support/topic/whatsapp-button-in-share-box/#post-938674

    Best regards,
    Ismael

    #938674

    Hey (Email address hidden if logged out) ,
    It looks like your code above for the link is not right, I believe this might be what you need to use:

    //Add items on the social share section
    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    	$args['Whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "https://whatsapp.com/share?text=[title]&url=[permalink]");
    	return $args;
    }

    Best regards,
    Mike

    #938238
    Jarmo
    Participant

    Hi,

    In an earlier post I read about adding the whatsapp button to your share box.

    I implemented this code in my functions.php file:

    add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    	$args['whatsapp'] = array("encode"=>true, "encode_urls"=>false, "pattern" => "whatsapp://send?text=[title]&url=[permalink]", 'label' => __("Deel via Whatsapp",'avia_framework'));
    	return $args;
    }

    but now if I click the whatsapp share button on my mobile it opens up the whatsapp core website.

    I read about adding this to your link:
    data-action="share/whatsapp/share"

    How can I add this function to my link so it will work nicely?

    #920851

    In reply to: blog set up

    Hi,
    As all of these solutions were added without editing any theme files you should have no issues updating.
    * I just looked back again and see the facebook translation was done editing: /wp-content/themes/enfold/includes/helper-social-media.php
    So since you can’t override a helper function inside a child theme. The override will only work for template files such as the header.php, loops, templates etc. You can copy the whole “social icon builder” function in your child theme functions.php.

    
    if(!class_exists('avia_social_share_links'))
    {
    	class avia_social_share_links
    	{
    		var $args;
    		var $options;
    		var $links = array();
    		var $html  = "";
    		var $title = "";
    		var $counter = 0;
    		
    		/*
    		 * constructor
    		 * initialize the variables necessary for all social media links
    		 */
    
    		function __construct($args = array(), $options = false, $title = false)
    		{
    			$default_arguments = array
    			(
    				'facebook' 	=> array("encode"=>true, "encode_urls"=>false, "pattern" => "http://www.facebook.com/sharer.php?u=[permalink]&t=[title]" , 'label' => __("Share with child theme",'avia_framework')),
    				'twitter' 	=> array("encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[shortlink]"),
    				'gplus' 	=> array("encode"=>true, "encode_urls"=>false, "pattern" => "https://plus.google.com/share?url=[permalink]" , 'label' => __("Share on Google+",'avia_framework')),
    				'pinterest' => array("encode"=>true, "encode_urls"=>true, "pattern" => "http://pinterest.com/pin/create/button/?url=[permalink]&description=[title]&media=[thumbnail]"),
    				'linkedin' 	=> array("encode"=>true, "encode_urls"=>false, "pattern" => "http://linkedin.com/shareArticle?mini=true&title=[title]&url=[permalink]"),
    				'tumblr' 	=> array("encode"=>true, "encode_urls"=>true, "pattern" => "http://www.tumblr.com/share/link?url=[permalink]&name=[title]&description=[excerpt]"),
    				'vk' 		=> array("encode"=>true, "encode_urls"=>false, "pattern" => "http://vk.com/share.php?url=[permalink]"),
    				'reddit' 	=> array("encode"=>true, "encode_urls"=>false, "pattern" => "http://reddit.com/submit?url=[permalink]&title=[title]"),
    				'mail' 		=> array("encode"=>true, "encode_urls"=>false, "pattern" => "mailto:?subject=[title]&body=[permalink]", 'label' => __("Share by Mail",'avia_framework') ),
    			);
    			
    			$this->args = apply_filters( 'avia_social_share_link_arguments', array_merge($default_arguments, $args) );
    			
    			if(empty($options)) $options = avia_get_option();
    			$this->options 	= $options;
    			$this->title 	= $title !== false? $title : __("Share this entry",'avia_framework');
    			$this->build_share_links();
    		}
    		
    		/*
    		 * filter social icons that are disabled in the backend. everything that is left will be displayed.
    		 * that way the user can hook into the "avia_social_share_link_arguments" filter above and add new social icons without the need to add a new backend option
    		 */
    		function build_share_links()
    		{
    			$thumb 					= wp_get_attachment_image_src( get_post_thumbnail_id(), 'masonry' );
    			$replace['permalink'] 	= !isset($this->post_data['permalink']) ? get_permalink() : $this->post_data['permalink'];
    			$replace['title'] 		= !isset($this->post_data['title']) ? get_the_title() : $this->post_data['title'];
    			$replace['excerpt'] 	= !isset($this->post_data['excerpt']) ? get_the_excerpt() : $this->post_data['excerpt'];
    			$replace['shortlink']	= !isset($this->post_data['shortlink']) ? wp_get_shortlink() : $this->post_data['shortlink'];
    			$replace['thumbnail']	= is_array($thumb) && isset($thumb[0]) ? $thumb[0] : "";
    			$replace['thumbnail']	= !isset($this->post_data['thumbnail']) ? $replace['thumbnail'] : $this->post_data['thumbnail'];
    			
    			$replace = apply_filters('avia_social_share_link_replace_values', $replace);
    			$charset = get_bloginfo('charset');
    			
    			foreach($this->args as $key => $share)
    			{
    				$share_key  = 'share_'.$key;
    				$url 		= $share['pattern'];
    				
    				//if the backend option is disabled skip to the next link. in any other case generate the share link
    				if(isset($this->options[$share_key]) && $this->options[$share_key] == 'disabled' ) continue;
    				
    				foreach($replace as $replace_key => $replace_value)
    				{
    					if(!empty($share['encode']) && $replace_key != 'shortlink' && $replace_key != 'permalink') $replace_value = rawurlencode(html_entity_decode($replace_value, ENT_QUOTES, $charset));
    					if(!empty($share['encode_urls']) && ($replace_key == 'shortlink' || $replace_key == 'permalink')) $replace_value = rawurlencode(html_entity_decode($replace_value, ENT_QUOTES, $charset));
    					
    					$url = str_replace("[{$replace_key}]", $replace_value, $url);
    				}
    				
    				$this->args[$key]['url'] = $url;
    				$this->counter ++;
    			}
    		}
    		
    		
    		
    		/*
    		 * function html
    		 * builds the html, based on the available urls
    		 */
    
    		function html()
    		{
    			global $avia_config;
    			
    			if($this->counter == 0) return;
    			
    			$this->html .= "<div class='av-share-box'>";
    			if($this->title)
    			{
    				$this->html .= 		"<h5 class='av-share-link-description'>";
    				$this->html .= 		apply_filters('avia_social_share_title', $this->title , $this->args);
    				$this->html .= 		"</h5>";
    			}
    			$this->html .= 		"<ul class='av-share-box-list noLightbox'>";
    			
    			foreach($this->args as $key => $share)
    			{
    				if(empty($share['url'])) continue;
    			
    				$icon = isset($share['icon']) ? $share['icon'] : $key;
    				$name = isset($share['label'])? $share['label']: __("Share on",'avia_framework'). " " .ucfirst($key);
    				
    				$blank = strpos($share['url'], 'mailto') !== false ? "" : "target='_blank'";
    				
    				$this->html .= "<li class='av-share-link av-social-link-{$key}' >";
    				$this->html .= 		"<a {$blank} href='".$share['url']."' ".av_icon_string($icon)." title='' data-avia-related-tooltip='{$name}'><span class='avia_hidden_link_text'>{$name}</span></a>";
    				$this->html .= "</li>";
    			}
    			
    			$this->html .= 		"</ul>";
    			$this->html .= "</div>";
    			
    			return $this->html;
    		}
    		
    		
    		
    		
    	}
    }
    

    I tested this in my localhost child theme to ensure it wourks, search for “Share with child theme” within this code and replace with your translation.

    Best regards,
    Mike

    #908109
    Heike
    Participant

    Hi,

    I want to replace the G+ social share button under the blogposts with a Xing button. I already added WhatsApp in my child themes functions.php with

    // Register new icon as a theme icon
    function avia_add_custom_icon($icons) {
    $icons[‘whatsapp’] = array( ‘font’ =>’whatsapp-font-icon’, ‘icon’ => ‘ue800’);
    return $icons;
    }
    add_filter(‘avf_default_icons’,’avia_add_custom_icon’, 10, 1);

    // Add new icon as an option for social icons
    function avia_add_custom_social_icon($icons) {
    $icons[‘Whatsapp’] = ‘whatsapp’;
    return $icons;
    }
    add_filter(‘avf_social_icons_options’,’avia_add_custom_social_icon’, 10, 1);

    //Add items on the social share section
    add_filter(‘avia_social_share_link_arguments’, ‘avia_add_social_share_link_arguments’, 10, 1);
    function avia_add_social_share_link_arguments($args)
    {
    $new_array = array(
    ‘whatsapp’ => array(
    “encode”=>true, “encode_urls”=>false, “pattern” => “whatsapp://send?text=[title]-[permalink]”
    )
    );

    return array_merge($new_array, $args);

    return $args;
    }

    How can I change G+ to Xing?

    Thanks.
    Heike

    #850335

    Hey AnaYogabrunch,

    You can add more social media button by using the “avia_social_share_link_arguments” filter. Example here:

    // https://kriesi.at/support/topic/adding-whatsapp-button-on-social-share-buttons/#post-573570

    Best regards,
    Jordan Shannon

    #849218
    Black-Shadow
    Participant

    Hello,

    i already read this http://kriesi.at/documentation/enfold/custom-social-icons/
    And it works very well.

    Now i need for this new icon a new function not simply a link.

    I want add a snippet

     if (function_exists('example')) {
            example();
        }

    What i must paste in functions.php ???
    Is this the right way?:

    add_filter('avia_social_share_link_arguments', 'avia_social_share_link_newfunction', 10, 1);
    if (function_exists('example')) {
            example();
        }
    

    This is what i already have there:

    // Register new icon as a theme icon
    function avia_add_custom_icon($icons) {
    	$icons['Ändere Schriftgröße']	 = array( 'font' =>'fontello', 'icon' => 'uf088');
    	return $icons;
    	
    }
    add_filter('avf_default_icons','avia_add_custom_icon', 10, 1);
    
    // Add new icon as an option for social icons
    function avia_add_custom_social_icon($icons) {
    	$icons['Change Fontsize'] = 'Ändere Schriftgröße';
    	return $icons;
    }
    add_filter('avf_social_icons_options','avia_add_custom_social_icon', 10, 1);
Viewing 30 results - 31 through 60 (of 103 total)