Black Friday sale! Get up to 25% off GP Premium! Learn more ➝

[Support request] Change widget order on GP Hooks

Home Forums Support [Support request] Change widget order on GP Hooks

Home Forums Support Change widget order on GP Hooks

  • This topic has 7 replies, 3 voices, and was last updated 6 years ago by Tom.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #435596


    I have inserted an Elementor widget after the content on ‘posts’ (a social share buttons type) via GP Hooks adding:

    <?php endif; ?><?php if ( is_single() ) : ?>
    [elementor-template id="4315"]
    <?php endif; ?>

    I have also installed a third party ‘Related posts’ widget, whch automatically places itself in 1st position ‘after the content’ on posts.

    I would like to be able to choose the order I want to place all these widgets (I will add a third widget) but can’t figure out how to do it on GP Hooks.

    Any recommendation?

    Many thanks!


    Customer Support

    Hi there,

    Not sure what you mean?

    The widgets should appear in the order that you add them?

    Let me know 🙂


    Hi Leo,

    The ‘related posts’ widget is added automatically, no need to do anything. On the other hand, I added an Elementor widget manually on GP hooks at the end of the posts as well.

    I haven’t included the related posts widget on GP hooks code myself and therefore I can’t control in which order I wish them to appear. It appears ‘related posts’ first, but I wanted to see my ‘Elementor’ widget first. Is it anything I could do? The only code I have included so far is as per above.

    Mnay thanks.


    Customer Support

    I’m not sure what you mean. How does Related Posts add content into GP hooks automatically?


    GeneratePress does not have an ‘after the post’ widget area in which I can drag in any widget to that area from WordPress Dashboard.

    Therefore, I am adding my own widget made on Elementor manually through GP Hooks on ‘After Content’.

    It displays ‘Social Media buttons’ succesfully:

    Afterwards, I wanted to have an additional widget to let me display ‘Related posts’. I downloaded a third party widget. Once installed, it is automatically placed after the post with no manual intervention. That means, the code on ‘After Content’ GP Hooks remains the same as before when I only had ‘Social Media buttons’, but I now have two widgets.

    My aim is to keep both widgets in this place, but I wanted to have them in opposite order. First ‘Social Media’, then ‘Related posts’. If I had both codes, I would just have to copy first one code and then the other. As I only have included manually the ‘Social Media widget’ code, I cannot change the order, nor I don’t know where to get the other code or how to modify it (if possible).

    My question is:
    is there any way I can change the order of the widgets by just writing some code on GP Hooks? How can I do it? As you can see, I’m not an expert and this is turning quite complicated for me.

    Lead Developer
    Lead Developer

    Plugins which filter into the content like the related posts plugin make it very difficult to control the order unfortunately.

    Does that plugin allow you to disable the automatic placement, and manually place their code? That would be the best way around it.

    Otherwise you’ll need to filter the_content, which is no fun.


    Thanks Tom. That sounds like bad news.

    Unfortunately, it does not allow automatic placement. It lets you add some CSS, not sure if we can work around there?

    I’m all ears for any alternative you might think, it was difficult to find a suitable plugin!

    Lead Developer
    Lead Developer

    It might be worth asking the developer – there’s usually a workaround to disable automatic placement, and then manually place it with a function.

    I try to avoid filtering the_content, as it can cause bugs elsewhere.

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