Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #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 FAQ

    It 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;
    }

    click to enlarge

    #868550

    Hey Guenter,

    Thanks a lot for sharing that! Much appreciated :-)

    Best regards,
    Rikard

    #1105174

    Is there an updated version for this and a way to increase the icon size ?

    Thanks.

    #1105368

    First: 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, 5 months ago by Guenni007.
    #1105955

    Hi,

    Thanks again for sharing @guenni007 :-)

    Best regards,
    Rikard

    #1121061

    @guenni007 Thanks for sharing this approach! Worked very well.

    Regards,
    RL

    #1121181

    Hi rlhinirv57,

    Great, I’m glad that you got it working :-)

    Best regards,
    Rikard

    #1138354

    by 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]

    #1138703

    Hi,

    Thanks for sharing and for helping out @guenni007 :-)

    Best regards,
    Rikard

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