[Resolved] After Content (incorrect function)

Home Forums Support [Resolved] After Content (incorrect function)

Home Forums Support After Content (incorrect function)

  • This topic has 9 replies, 2 voices, and was last updated 6 years ago by Tom.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #552559
    Bill

    On the latest version of GP I’ve noticed that the function in page.php

    do_action(generate_after_main_content)

    Doesn’t work, it should be:

    do_action(generate_after_content)

    Working in local host

    Thanks

    #552858
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Those are two different hooks in different locations.

    generate_after_content can be found in content-page.php: https://github.com/tomusborne/generatepress/blob/2.0.2/content-page.php#L60

    #552871
    Bill

    Thanks for your fast reply as always, much appreciated.

    Ah, I’m using, front-page.php and the original hook I took from page.php do_action(generate_after_main_content) didn’t work, changing it to do_action(generate_after_content) works fine though, is that a bug?

    #552873
    Bill

    Hey Tom,

    Looks like it was that NexGEN Gallery again.. Gets me everytime.

    Might be worth putting a warning that the plugin is not compatible with GP until they fix it.

    Thanks for your time.

    That is not correct, sorry.

    #552874
    Tom
    Lead Developer
    Lead Developer

    What about it didn’t work? If you have a function hooking into generate_after_content, then calling generate_after_main_content won’t work. The hook names need to match up between the template and the function.

    #552875
    Tom
    Lead Developer
    Lead Developer

    What exactly was NextGen doing?

    #552878
    Bill

    Sorry Tom, its been one of those days..

    I tried to put some code into After Content in GP Hooks but it wouldn’t show.

    It does however work if I change to generate_after_content in front-page.php

    Thanks

    #552882
    Tom
    Lead Developer
    Lead Developer

    Ah, got it. Hooks is getting a total makeover which will allow you to use any hook that exists in the theme. Should make it waaay easier 🙂

    #552888
    Bill

    Sounds great, thanks a lot for your help, love the theme and plugin, keep up the hard work 🙂

    #552892
    Tom
    Lead Developer
    Lead Developer

    Thank you! 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.