-
AuthorPosts
-
June 22, 2018 at 11:38 am #976262
Hello,
I would like to include our social icons (Facebook, Twitter, LinkedIn, basically everything that we configure in the Social Profiles area of the Enfold theme settings) in a footer widget column with a title such as “Connect with us”.
Note: I don’t wnat them in the socket, which is the only way the theme settings will display them.
I like the square icons that are displayed via the widget “RSS Link and Twitter Feed”.
The website URL is https://divcorporate.wpengine.com
When we launch the site, the URL will be http://diversifiedus.com (I can modify the domain in the code when the time comes to launch).Can you provide the HTML to place in the Widget area, and any necessary Quick CSS code?
Thanks,
AdamJune 22, 2018 at 12:09 pm #976283if you like to obtain that very elegant – this is a custom widget i wrote for that case – code comes to function.php of your child-theme:
The generated widget is called (as you see in the code). Enfold-Child-Social-Bookmarks/*** 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; } }
to have the same look as other widgets – this comes to child-theme 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 then only have to pull that widget to your footer widget-area you like – title in your case is then: Connect with us
June 22, 2018 at 12:17 pm #976287see here in action. https://webers-testseite.de/#footer
June 22, 2018 at 1:34 pm #976319June 27, 2018 at 1:24 pm #978398It is really fun to share my work and knowledge here. ;)
I really feel the enthusiasm to continue.June 27, 2018 at 3:51 pm #978466Thank you very much Guenni007! I was on vacation and didn’t have access for a few days. This is great, much appreciated.
June 28, 2018 at 4:55 am #978715 -
AuthorPosts
- You must be logged in to reply to this topic.