Last active
September 6, 2020 06:34
-
-
Save nickcernis/7f28330b4ed2f2e22a2c to your computer and use it in GitHub Desktop.
Genesis Simple Share Shortcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
Just to let you know that the $Genesis_Simple_Share variable name has been updated to $genesis_simple_share (lower case). Using the capitalised version will no longer work.
@ADAPTiveBen Thank you — this has been corrected above.
I have tried to use this to shows icons on wigetized home page.. they don't show... source code shows them there but there's no visual output.
Any ideas?
@KramazGIT, it seems that it will only work if you are using static home page
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is great! just What i was looking for. Thanks million!