Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #481556

    Hello!
    I somewhat understand coding, and after finding this thread I was pleased to see changing the RSS to Facebook. However I would like Linkedin, Pinterest, and Instagram added in this fashion. Is there a layout I can do this in that I can add to the code?

    Here is the code from the previous thread for reference

    	function widget($args, $instance) {
    			// prints the widget
    
    			extract($args, EXTR_SKIP);
    			$twitter = empty($instance['twitter']) ? '' : $instance['twitter'];
    			$facebook = empty($instance['facebook']) ? '' : $instance['facebook'];
    
    			if(!empty($twitter) || !empty($rss))
    			{
    				$addClass = "asc_multi_count";
    				if(!isset($twitter) || !isset($rss)) $addClass = 'asc_single_count';
    
    				echo $before_widget;
    				$output = "";
    				if(isset($twitter))
    				{
    					$link = 'http://twitter.com/'.$twitter.'/';
    					$before = apply_filters('avf_social_widget', "", 'twitter');
    					$output .= "<a href='$link' class='asc_twitter $addClass'>{$before}<strong class='asc_count'>".__('Follow','avia_framework')."</strong><span>".__('on Twitter','avia_framework')."</span></a>";
    					
    				}
    
    				if(isset($facebook))
    				{
    					$link = 'http://facebook.com/';
    					$before = apply_filters('avf_social_widget', "", 'facebook');
    					$output .= "<a href='$link' $addClass'>{$before}<strong class='asc_count'>".__('Follow','avia_framework')."</strong><span>".__('on Facebook','avia_framework')."</span></a>";
    					
    				}
    
    				echo $output;
    				echo $after_widget;
    			}
    		}
    #483716

    Hi brittanywinter!

    Thank you for using Enfold.

    You can follow the code pattern when you switch the rss to facebook. I’m sure you will know where to add the following code. Let’s try to add the pinterest icon. Add this code:

    $pinterest = empty($instance['pinterest']) ? '' : $instance['pinterest'];
    

    And this one:

    if(isset($pinterest))
    				{
    					$link = 'http://pinterest.com/';
    					$before = apply_filters('avf_social_widget', "", 'pinterest');
    					$output .= "<a href='$link' $addClass'>{$before}<strong class='asc_count'>".__('Follow','avia_framework')."</strong><span>".__('on Pinterest','avia_framework')."</span></a>";	
    				}
    

    Below, look for this line of code:

    $instance = wp_parse_args( (array) $instance, array('rss' => avia_get_option('feedburner'), 'twitter' => avia_get_option('twitter')) );
    

    Add the pinterest option:

    $instance = wp_parse_args( (array) $instance, array('rss' => avia_get_option('feedburner'), 'twitter' => avia_get_option('twitter'), 'pinterest' => avia_get_option('pinterest') ) );
    

    And again, find this line:

    <p><label for="<?php echo $this->get_field_id('rss'); ?>">Enter your feed url:
    			<input class="widefat" id="<?php echo $this->get_field_id('rss'); ?>" name="<?php echo $this->get_field_name('rss'); ?>" type="text" value="<?php echo esc_attr($rss); ?>" /></label></p>
    

    Follow the pattern, add something like this:

    <p><label for="<?php echo $this->get_field_id('pinterest'); ?>">Enter your pinterest username:
    			<input class="widefat" id="<?php echo $this->get_field_id('pinterest'); ?>" name="<?php echo $this->get_field_name('pinterest'); ?>" type="text" value="<?php echo esc_attr($pinterest); ?>" /></label></p>

    After that, there will be a new field in the widget for the pinterest icon.

    Cheers!
    Ismael

    #506725

    Hello,

    Looking to add Instagram, this thread looks promising.

    What .php file do I need to edit this in?

    #506970

    Hey!

    refer to this post brittanywinter linked in her first post: https://kriesi.at/support/topic/replace-rss-by-facebook-widget-footer/#post-312541

    Regards,
    Andy

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.