Site logo

[Resolved] Move sidebar right after post content

Home Forums Support [Resolved] Move sidebar right after post content

Home Forums Support Move sidebar right after post content

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2451479
    George

    Is it possible to relocate the single post sidebar element just after the main content (i.e. before opt-in form, author bio, or social share buttons) for mobile only? Social share buttons along with subscription form and author box are added with an after_content hook and 0 priority. Related posts are added with a before_comments_container hook and a default priority of 10.

    #2451713
    David
    Staff
    Customer Support

    Hi George,

    it is possible to unhook the sidebar and hook it back in using the wp_is_mobile() template tag.
    BUT, if your site is using Page Caching then it would need separate Caches for Mobile and Desktop.

    The alternative is to unhook those other elements including the comments and hook them in before_footer then the sidebar will appear between those.

    #2451795
    George

    The before_footer solution requires multiple changes all around. I was wondering if I would be better off creating another GP aside element for mobile and setting that to appear after the content, hiding the original one on mobile?

    #2452002
    George

    Ok, I’ve created two sidebar elements with the content inside them as a reusable block and I am displaying the extra sidebar element on mobile only and after the content hiding the original one on mobile.

    Thanks, David.

    #2452743
    David
    Staff
    Customer Support

    Glad to hear you found a working solution 🙂

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