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

    Hello,

    How can I add social media icons to the footer widget? Not to the footer socket, I would like to add this to the footer widget. In the widget menu, I see a lot of enfold widget, but unfortunately I dont see the enfold social icons widget.

    Thank you very much!

    #1412690

    Hey Danii28,
    Unfortunately there is not a specific widget to show the social icons, but you can use this shortcode solution by Guenni007 to create a shortcode [social-bookmarks] in a Custom HTML widget.

    Best regards,
    Mike

    #1412697

    Yes that is a quick and dirty way:

    A way to have there a widget :

    
    /*** custom social bookmarks widget  ****/
    function social_bookmarks_register_widget() {
      register_widget( 'add_social_bookmarks' );
    }
    add_action( 'widgets_init', 'social_bookmarks_register_widget' );
    
    class add_social_bookmarks extends WP_Widget {
      public function __construct() {
        $widget_ops = array(
          'classname' => 'socialbookmarks-widget', 
          'description' => __('A widget that displays the social bookmarks', 'avia_framework') 
          );
        parent::__construct( 'add_social_bookmarks', THEMENAME.' Social Bookmarks', $widget_ops );
      }
    
      public function widget( $args, $instance ) {
        $title = apply_filters( 'widget_title', $instance['title'] );
        echo $args['before_widget'];
        //if title is present
        if ( ! empty( $title ) )
        echo $args['before_title'] . $title . $args['after_title'];
        //output
        echo $before_widget;
        $social_args = array('outside'=>'ul', 'inside'=>'li', 'append' => '');
        echo avia_social_media_icons($social_args, false);
        echo $after_widget;
      }
    
      public function form( $instance ) {
        if ( isset( $instance[ 'title' ] ) )
        $title = $instance[ 'title' ];
        else
        $title = __( 'Social Bookmarks', 'avia_framework' );
        ?>
        <p>
        <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
        <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
        </p>
        <?php
      }
    
      public function update( $new_instance, $old_instance ) {
        $instance = array();
        $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
        return $instance;
      }
    }

    and for quick css:

    #top .socialbookmarks-widget .social_bookmarks {
        float: left;
        margin: 15px 0 0 ;
        position: relative;
    }
    
    #top .socialbookmarks-widget .social_bookmarks li {
        float: left;
        clear: right !important;
    }

    but: these are only the social button you have set on enfold options dialaog.

    #1412702

    Hi,
    Thank you for sharing Guenni007!

    Best regards,
    Mike

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