• Resolved jharries

    (@jharries)


    Hi Robin,

    I fear I’m doing something very stupid, but I just can’t get the filter. you provide to hook the icons onto the generate press generate_after_content hook

    I have tried everything I can think of including several permutations of the code below. Nothing seems to work. I have made sure I have posts check box set to manual only in the settings.

    Help would be much appreciated.

    Thanks

    add_filter( ‘scriptlesssocialsharing_locations’, ‘prefix_change_sss_locations’ );
    function prefix_change_sss_locations( $locations ) {
    $locations[‘before’] = array(
    ‘hook’ => ‘generate_after_content’,
    ‘filter’ => false,
    ‘priority’ => 8,
    );
    $locations[‘after’] = array(
    ‘hook’ => ‘generate_after_content’,
    ‘filter’ => false,
    ‘priority’ => 8,
    );

    return $locations;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    That code modifies the locations that the button location settings use–so your code is fine, but it doesn’t work with the manual placement, but the Before/After Content settings. The manual placement setting is if you are using your own code to insert the buttons instead of using the predefined locations.

    Since you have the same code for both locations, I would suggest removing the code for the $locations['before'] setting and just keep the $locations['after']. Then make sure that the “After Content” location is checked and your preferred hook will be used. HTH

    Thread Starter jharries

    (@jharries)

    Hi Robin,

    That fixed it, thanks.

    Sorry, I did not read your instructions carefully enough.

    Thanks for the very quick reply.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can’t get hook filter to work with Generate Press theme’ is closed to new replies.