Tagged: GuennisTut
-
AuthorPosts
-
October 24, 2017 at 12:01 pm #868126
on a thread there was the quest to put the sozial Bookmarks to the footer widget areas ( not the socket )
and i like to have this in an extra thread because i will create some Tuts here with FAQIt is possible to make a custom widget here with enfold input. It seems to be complicated but if it is done – it is easy to use.
You then have a new Widget called “Enfold-Child Social Bookmarks” or whatever your Themename is
You can drag&drop it whereever you like – and it shows the Bookmarks of the Enfold Options Page you set.this goes to functions.php of the 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; } }
to have the same styling as the other Widgets:
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; }
October 25, 2017 at 6:39 am #868550Hey Guenter,
Thanks a lot for sharing that! Much appreciated :-)
Best regards,
RikardMay 29, 2019 at 3:01 pm #1105174Is there an updated version for this and a way to increase the icon size ?
Thanks.
May 30, 2019 at 7:09 am #1105368First: why an updated version? it still works on Enfold 4.5.7 and WP 5.2.1
you can influence it same as the top navigation area with quick css:
#top .socialbookmarks-widget .social_bookmarks { display: inline; } #top .socialbookmarks-widget .social_bookmarks li { border-right-width: 0; width: 50px; } #top .socialbookmarks-widget .social_bookmarks li a { width: 50px; line-height: 50px; min-height: 50px; } #top .socialbookmarks-widget .social_bookmarks li a:before{ font-size:30px }
Result with 50px : https://webers-testseite.de/#footer
That widget area in the middle: Social Bookmarks Widget- This reply was modified 5 years, 6 months ago by Guenni007.
June 1, 2019 at 5:45 am #1105955July 23, 2019 at 1:24 am #1121061@guenni007 Thanks for sharing this approach! Worked very well.
Regards,
RLJuly 23, 2019 at 12:47 pm #1121181September 14, 2019 at 5:06 pm #1138354by the way if you could live with a manual setting of a shortcode:
this to child-theme functions.php:
function social_bookmarks_shortcode() { $social_args = array('outside'=>'ul', 'inside'=>'li', 'append' => ''); $social = avia_social_media_icons($social_args, false); return $social; } add_shortcode('social-bookmarks', 'social_bookmarks_shortcode');
to see the ul list items besides each other this
to quick css:.widget ul.social_bookmarks { display: inline-flex; }
the shortcode is: [social-bookmarks]
September 16, 2019 at 8:50 am #1138703 -
AuthorPosts
- You must be logged in to reply to this topic.