Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #897718

    Hello, I found a topic that is closed, with the response to add this to the custom CSS:

    .widget .social_bookmarks li { clear: none; border: none !important; }

    What html needs to be added to the widget to make this work?

    Thank you,

    #897836

    Hey c3idesign,

    Please, provide your WP credentials.

    Best regards,
    John Torvik

    #898060

    Included in pc below

    #898460

    Hi c3idesign,

    You can add a text widget to the footer and there the html with the social links. The html will depend on how you need the icons or links to look like.

    Could you please attach a mockup of what you’re trying to achieve?

    Best regards,
    Victoria

    #898501

    yes this will work – if you like to have a real widget you can do this to
    functions.php of your child-theme:

    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 this to 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;
    }

    you will have than a social bookmark widget.
    it shows all of your scocial bookmarks from the options dialog of enfold. – You have the choice to give it a heading like on every other widget .

    see here in footer : Link

    #898506

    or if you like to generate a social-bookmarks shortcode add this to functions.php of your child-theme:

    
    function social_bookmarks_shortcode() {
      $social_args = array('outside'=>'ul', 'inside'=>'li', 'append' => '');
      echo avia_social_media_icons($social_args, false);
    }
    add_shortcode('social-bookmarks', 'social_bookmarks_shortcode');

    you can insert the social bookmarks than with the shortcode:
    [social-bookmarks]

    after that you have to style them via quick css

    #898513

    Guenni007 – thank you! Worked perfectly! (the widget)

    • This reply was modified 6 years, 10 months ago by c3idesign.
    #898552

    Hi,

    Great! I’m glad you got this corrected. If you need addtional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Add social icons to footer widget (not socket)’ is closed to new replies.