-
AuthorPosts
-
January 15, 2018 at 10:09 pm #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,
January 16, 2018 at 3:41 am #897836Hey c3idesign,
Please, provide your WP credentials.
Best regards,
John TorvikJanuary 16, 2018 at 4:40 pm #898060Included in pc below
January 17, 2018 at 1:15 pm #898460Hi 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,
VictoriaJanuary 17, 2018 at 3:45 pm #898501yes 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
January 17, 2018 at 4:02 pm #898506or 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
January 17, 2018 at 4:28 pm #898513Guenni007 – thank you! Worked perfectly! (the widget)
- This reply was modified 6 years, 11 months ago by c3idesign.
January 17, 2018 at 5:12 pm #898552Hi,
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 -
AuthorPosts
- The topic ‘Add social icons to footer widget (not socket)’ is closed to new replies.