Custom Alterations Social Widget Follow Me (1 post)

  1. SallyWingles
    Posted 2 years ago #

    I hope I do this right so please forgive me if I mess up posting this.

    I was curious to see if I could add a custom choice to the social-widget.php.

    I of course backed up the original, then with a copy I made my additions to the social-widget.php -- uploaded it to the server, but I get 500 error with something to do with admin.php

    I replaced my backup so no harm done. I've enclosed The alterations I did make. I think there is more I must do to other files to make this work. I've only enclosed the areas I altered with notepad++ to add a new social icon (Steam) as shown below. NOTE (Yes I realize I didn't update my icon to reflect steam.png (could this cause the issue?)

    /* Our variables from the widget settings. */
    		$title = apply_filters('widget_title',
    $instance['title'] );
    		$rss = $instance['rss'];
    		$facebook = $instance['facebook'];
    		$twitter = $instance['twitter'];
    		$youtube = $instance['youtube'];
    		$flickr = $instance['flickr'];
    		$steam = $instance['steam'];

    and then

    <div class="sidebar-social">
    				<?php if($rss) { ?><a href="<?php echo $rss; ?>" title="<?php _e('Subscribe to RSS feed','gamepress') ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/icons/rss.png" alt="Subskrybuj RSS" /></a><?php } ?>
    				<?php if($facebook) { ?><a href="<?php echo $facebook; ?>" title="<?php _e('Follow me on Facebook','gamepress') ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/icons/facebook.png" alt="Facebook" /></a><?php } ?>
    				<?php if($twitter) { ?><a href="<?php echo $twitter; ?>" title="<?php _e('Follow me on Twitter','gamepress') ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/icons/twitter.png" alt="Twitter" /></a><?php } ?>
    				<?php if($youtube) { ?><a href="<?php echo $youtube; ?>" title="<?php _e('Follow me on YouTube','gamepress') ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/icons/youtube.png" alt="YouTube" /></a><?php } ?>
    				<?php if($flickr) { ?><a href="<?php echo $flickr; ?>" title="<?php _e('Follow me on Flickr','gamepress') ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/icons/flickr.png" alt="Flickr" /></a><?php } ?>
    				<?php if($steam) { ?><a href="<?php echo $steam; ?>" title="<?php _e('Follow me on Steam','gamepress') ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/icons/flickr.png" alt="Steam" /></a><?php } ?>

    and then

    /* Strip tags for title and name to remove HTML (important for text inputs). */
    		$instance['title'] = strip_tags( $new_instance['title'] );
    		$instance['rss'] = $new_instance['rss'];
    		$instance['facebook'] = $new_instance['facebook'];
    		$instance['twitter'] = $new_instance['twitter'];
    		$instance['youtube'] = $new_instance['youtube'];
    		$instance['flickr'] = $new_instance['flickr'];
    		$instance['steam'] = $new_instance['steam'];

    and this part I've only showed the addition not the full code for this section

    <!-- Steam URL -->
    			<label for="<?php echo $this->get_field_id( 'steam' ); ?>"><?php _e('URL address of your Steam profile page','gamepress') ?>:</label>
    			<input id="<?php echo $this->get_field_id( 'steam' ); ?>" name="<?php echo $this->get_field_name( 'steam' ); ?>" value="<?php echo $instance['steam']; ?>" style="width:90%;" />
    			<small><?php _e('Enter full URL of your Steam profile page. If you don\'t want to display this, leave empty.','gamepress') ?></small>

    Again, this is not the complete social-widget.php content, but rather just so you can see the areas I did alter. I just simply copied a line and edited to read steam instead. I had no luck so I am hopeful someone can steer me in the right direction as I would like to add a custom social icon to the Gamepress Follow Me Widget.

    Thank you for your time.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic