Skip to content

Instantly share code, notes, and snippets.

@planetahuevo
Forked from nickcernis/functions.php
Created October 2, 2018 17:15
Show Gist options
  • Save planetahuevo/2110dfc88ba3936c8a24d41b7695cdb7 to your computer and use it in GitHub Desktop.
Save planetahuevo/2110dfc88ba3936c8a24d41b7695cdb7 to your computer and use it in GitHub Desktop.
Genesis Simple Share Shortcode
<?php
// Adds a [social-icons] shortcode to output Genesis Simple Share icons in posts
// https://wordpress.org/plugins/genesis-simple-share/
// Add the code below to your active theme's functions.php file,
// or use in a site-specific plugin.
// The shortcode takes no attributes; change your icon settings via Genesis → Simple Share.
add_shortcode( 'social-icons', 'gss_shortcode' );
function gss_shortcode() {
global $Genesis_Simple_Share;
$icons = '';
if ( function_exists( 'genesis_share_get_icon_output' ) ) {
$location = uniqid( 'gss-shortcode-' );
$icons = genesis_share_get_icon_output( $location, $Genesis_Simple_Share->icons );
}
return $icons;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment