Technique For Creating Portable Social Menus In WordPress Themes

One of the features within the Stargazer child theme we are using on WPTavern are the social icons located at the bottom of the site. The social icons are not images but rather, Genericons. As explained by Konstantin Kovshenin, Justin Tadlock used a method to add social network icons that are portable between themes. By using a few simple CSS selectors, the social links are able to be targeted by their href attribute.

No more plugin dependencies, no more long docs of CSS class names, no more arguing with the Theme Reviewers Theme on WordPress.org that social profile icons are part of the appearance of a theme and not “plugin territory” because users can lose their content upon theme switch.

Justin Tadlock published two different posts that explain the thought process behind the technique as well as the code needed to make it work. It’s being championed by the WordPress theme community to the point of it possibly being added to the WordPress Theme Review Guidelines.