Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[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 3 years ago by Tom.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #435596
    Alvaro

    Hello,

    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!

    Al

    GP Premium 1.5.5
    #435790
    Leo
    Staff
    Customer Support

    Hi there,

    Not sure what you mean?

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

    Let me know 🙂

    #435852
    Alvaro

    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.

    Al

    #436133
    Leo
    Staff
    Customer Support

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

    #436296
    Alvaro

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

    https://ibb.co/cUDZ06

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

    https://ibb.co/fBvxL6

    It displays ‘Social Media buttons’ succesfully:

    https://ibb.co/hiJWDR

    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.

    https://ibb.co/eWwwf6

    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.

    #436651
    Tom
    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.

    #436704
    Alvaro

    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?
    https://ibb.co/cj4Bxm

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

    #437072
    Tom
    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.