Unable to move the button location
-
Hi Robin and thanks for this super lightweight plugin. I want to move where the buttons are output and copied and pasted the code below into my Genesis theme (Digital Pro) functions.php file but the icons don’t display.
add_filter( ‘scriptlesssocialsharing_locations’, ‘prefix_change_sss_locations’ );
function prefix_change_sss_locations( $locations ) {
$locations[‘before’] = array(
‘hook’ => ‘genesis_before_entry’,
‘filter’ => false,
‘priority’ => 8,
);
$locations[‘after’] = array(
‘hook’ => ‘loop_end’,
‘filter’ => false,
‘priority’ => 8,
);return $locations;
}The “Use Genesis Framework hooks for button locations” is checked, Manual Placement for Posts and Pages is checked and Before and After Content unchecked. I have tried the code at top and bottom of functions.php and changed priority’s (in the code) from low to high values. I have also tried all this using the non Genesis WordPress 2017 theme but no joy. The buttons show if I check ‘Use Before and After content’, the default locations.
I tried using this old code snippet you gave to someone a few years ago and it works in my functions.php file: –
add_action( ‘genesis_before_footer’, ‘prefix_scriptlesssocialsharing_buttons_entry_content’, 5 );
function prefix_scriptlesssocialsharing_buttons_entry_content() {
echo wp_kses_post( scriptlesssocialsharing_do_buttons() );
}Any suggestions? Do I need to use additional code or something?
Thanks
Paul
- The topic ‘Unable to move the button location’ is closed to new replies.