[Resolved] Want to replace my previous social share bars

Home Forums Support [Resolved] Want to replace my previous social share bars

Home Forums Support Want to replace my previous social share bars

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #363243
    Tom
    Lead Developer
    Lead Developer

    Glad you found the solution! ๐Ÿ™‚

    #443575
    Eric

    I updated to GP Premium 1.5.6 and GP 2.0 and it seems that my previous fix won’t work anymore.

    I don’t even see the hook “generate_after_page_header” anymore. Was this removed or replaced by something?

    As it stands, I can only add a share bar before the featured image, but I want it after.

    #443618
    Tom
    Lead Developer
    Lead Developer

    That hook still exists.

    However, in GPP 1.5, the page header functionality was separated from the featured image functionality. Are you only using a static image?

    #443875
    Eric

    Are you only using a static image?

    The featured images I use are unique to each article (inserted using the native featured image option in WordPress) and the social share buttons were created using Elementor.

    I’ve previously added a special code using Snippets to get those social share buttons to appear under the featured image and at the end of the article.

    #444299
    Tom
    Lead Developer
    Lead Developer

    Any chance you can link me to one of the pages where the icons disappeared from?

    #444309
    Eric

    Any of my articles, but here’s an example

    https://www.veganostomy.ca/ostomy-filter-stickers/

    You can see the share buttons at the end of the article – those should also be right under the featured image. I made no changes to the snippet code I had from before updating to the newer version.

    #444515
    Tom
    Lead Developer
    Lead Developer

    The code I have you earlier should work for that location:

    add_action( 'generate_after_entry_header', 'tu_add_social_icons', 15 );
    function tu_add_social_icons() {
       echo do_shortcode( '[elementor-template id="20458"]' );
    }
    #444527
    Eric

    Unfortunately,”generate_after_entry_header” used to work until something changed in August, so I had to start using “generate_after_page_header” but now that’s broken.

    #444544
    Tom
    Lead Developer
    Lead Developer

    Have you tried again recently? That hook exists here: https://github.com/tomusborne/generatepress/blob/2.0/content-page.php#L40

    Regardless of anything in GP Premium, that hook will work.

    #444823
    Eric

    Oh, man. It was a caching issue :/ I had applied the code a few posts up and it didn’t work at first, so I tested on my staging site and it was fine. I cleared the litespeed cache and now it’s working =)

    Thanks, Tom!!

    #444917
    Tom
    Lead Developer
    Lead Developer

    No problem! ๐Ÿ™‚

Viewing 11 posts - 16 through 26 (of 26 total)
  • You must be logged in to reply to this topic.