[Resolved] Hook "after content" no longer showing related post

Home Forums Support Hook "after content" no longer showing related post

  • This topic has 14 replies, 3 voices, and was last updated 1 year ago by Tom.
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1210065
    Matt

    Hi there. I have two sites that use Bibblio for related posts. I had injected that code via Elements – using the after content hook and “singular” pages. Worked like a dream.

    I recently updated GeneratePress on one site (but not on another – hadn’t gotten to it). On the site I updated, that code no longer will fire. It shows in my view source, and the “related” text shows after content, but the related post section won’t appear. On the site where I didn’t update, the hook is still working perfectly and showing the related posts.

    I’m not sure where to start to troubleshoot this. Were there any changes to the hooks with the latest update – or to the theme itself that would disallow specific code to fire?

    #1210074
    Matt

    BTW – I just updated the other site listed, and the minute I did, the Bibblio code stopped working on that site too. It just won’t fire as it did in the previous after content hook set-up. Definitely related to the update.

    I also tried using a plugin to inject the code as a widget after content – and it won’t fire that way either. Tried clearing all caches, etc. So don’t know if it’s related to the hook – looks more related to some other change in the update impacting the code from showing.

    #1210091
    Leo
    Staff
    Customer Support

    Hi there,

    All hooks do is to let you add code/content to the specific places. It really doesn’t have the ability to decide whether the code is executed or not.

    What is the code you are adding? Does it execute anywhere at all?

    #1210099
    Matt

    Hi Leo,

    It looks like this (taken out any aspects related to codes specific to my site):

    <div class=”bib–rcm-init”
    data-recommendation-key=”0000000000000″
    data-style-classes=”bib–box-5 bib–split bib–size-16 bib–wide bib–site-show”
    data-custom-catalogue-ids=”website,website”
    data-query-string-params=”network recirc=bibblio”>

    It’s definitely not the hooks area. It’s related to the update. On my second site I hadn’t updated, the hook was working perfectly. 15 minutes ago I decided to try and test whether the update “broke” the code from firing. Once I updated, the related posts vanished – just like on the first site I updated. It won’t even fire if I add a plugin to inject it after the post. Seems to be directly related to the update since it disappeared the minute I updated.

    #1210103
    Matt

    My host just reverted to my back-up pre-update on the site I just tested, and the Bibblio widget now shows just fine.

    It’s still not working on the site that’s running the newest version of GeneratePress. I could look to revert back to a back-up and see if I can find the right one pre-update. But wanted to see if you all had any thoughts what may be the issue before I land in a spot where I simply can’t update the theme any longer.

    #1210106
    Leo
    Staff
    Customer Support

    Are you able to test if the code executes correctly using a twenty series default WP theme?

    What version of GP theme are you updating from?

    #1210133
    Matt

    I keep up on updates, so whichever was the last version. And when I rolled back to the last version from a back-up, it started to work again on one of the sites.

    Trying to get a staging site up to test on the site that’s still on the most current theme update.

    #1210149
    Leo
    Staff
    Customer Support

    So between 2.4.1 and 2.4.2, the only changes are these:
    https://generatepress.com/generatepress-2-4-2/

    Does the code execute in the normal page content?

    #1210155
    Matt

    I just tested injecting the code directly onto a post.

    Site on 2.4.1: Injected and showed (showed twice, once for the injection, once for the hook)

    Site on 2.4.2: Injected and didn’t show (neither the injection or the hook)

    The hook is being seen as I have an h2 in there for “related”. Shows that, but nothing else is showing.

    #1210157
    Matt

    Is there a way to reinstall 2.4.1 without reverting to a back-up from my host? I don’t recall which day I updated to choose the right back-up and I published content since then so would prefer not to chance having to rebuild that.

    #1210158
    Leo
    Staff
    Customer Support

    Can you provide a link to each set up with all plugins disabled except GP Premium and the related post plugin?

    #1210168
    Matt

    Unfortunately not – the issue won’t show on a staging site as Bibblio won’t show on my staging site since it’s not my website. And I can’t turn off my entire site (the plugins) to test. It gets a decent amount of traffic.

    Both sites use most of the same plugins as it stands. And it’s working on one on 2.4.1 and not on 2.4.2. My ad network made some adjustments to add a new ad unit in before my comments section, but don’t think that would be doing it either, as other hooks that I have built are showing up above it. Looks to simply be this specific code.

    There’s also no “related post” plugin – it’s just that code that calls the related post section in.

    Is there a way to get a 2.4.1 version of the theme to reload? Otherwise I’m going to try to revert to a backup to see if they reappear under 2.4.1.

    #1210214
    Tom
    Lead Developer
    Lead Developer

    There are no front-end code differences between 2.4.1 and 2.4.2. Every single change was in the block editor only, and it was all CSS: https://github.com/tomusborne/generatepress/commit/6f641c6d1af9ca00a6dc0a70ec2a665da7a44798

    Did you/anyone make any changes to the core theme code in 2.4.1? That’s the only explanation I can think of, unless there’s some sort of strange caching going on.

    Maybe something injected into header.php?

    You can download 2.4.1 here: https://wordpress.org/themes/download/generatepress.2.4.1.zip

    #1210592
    Matt

    Hey there – this has been resolved. The issue was updating, but nothing on your end. I wasn’t aware that the person I had help set up the related post widget had placed code on a template theme page, so it was overwritten on the update.

    Thanks for your patience and help!

    #1210990
    Tom
    Lead Developer
    Lead Developer
Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.