Site logo

[Resolved] Dynamic Authorbox in sidebar for blog posts

Home Forums Support [Resolved] Dynamic Authorbox in sidebar for blog posts

Home Forums Support Dynamic Authorbox in sidebar for blog posts

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1734608
    Ezra

    Hi there,
    I’ve long been a fan of GP, and now I’m using it for the biggest project I’ve attempted yet! 🙂 I’m re-creating a site that was built with page builders and making it lean and fast with GP. I’ve learned a lot along the way, but there’s one thing that’s got me stumped.

    I’d like to have an authorbox (widget maybe?) that shows in the right sidebar (bottom of post for mobile) which will display an author’s photo and a brief bio. The site currently has several authors, so ideally I’d like a way for the correct author’s photo/bio to be displayed automatically, without having to manually select a widget for each new post that is created. Is such a thing possible with GP, and if so, how?
    Thanks!

    #1734630
    Ezra

    I had been searching the forums for a while before I posted, but then shortly after posting, I found this: https://generatepress.com/forums/topic/add-author-bio-in-sidebar-with-any-plugin/
    So far it’s working! I might run into some snags and need some help, but for now I’m going to experiment with this, and see if I can make it work. 🙂

    #1734653
    Elvin
    Staff
    Customer Support

    Glad you found something that works for you. 🙂

    I see you’re still experimenting on things.

    Consider using the GP Premium 2.0’s block element update for this. It’s great! 😀
    https://generatepress.com/introducing-the-gp-theme-builder/

    #1734666
    Ezra

    Thanks Elvin! I have been hearing about the awesome new block element update, but wasn’t sure how to go about testing it while leaving the rest of my site intact… 🙂 If I install the new beta version, do I need to disable/uninstall the current plugin? If so, how do I ensure that I don’t lose anything in the switch?

    #1734675
    Ezra

    Also, a couple of questions regarding the widget that I created following these intructions
    On a mobile device the widget seems to go all the way to the bottom of the page, below the comments. Is there a way to put it at the end of the article, before the comments?

    Also, is there any way to pull in a custom image for each author, rather than a gravatar? Most of the authors don’t even have one set, and I don’t want to have to bother them to go online and create an account just for this. We already have images uploaded to WP, we just need a way to tell the widget which image to display. (Ideally without creating a new shortcode for each one.)

    #1734697
    Elvin
    Staff
    Customer Support

    Thanks Elvin! I have been hearing about the awesome new block element update, but wasn’t sure how to go about testing it while leaving the rest of my site intact… 🙂 If I install the new beta version, do I need to disable/uninstall the current plugin? If so, how do I ensure that I don’t lose anything in the switch?

    GP Premium is an update over the current one. There’s no need to uninstall anything. Just update the current one.

    If you’re unsure, I highly recommend creating a making a copy of your site to a staging site so the live one doesn’t get affected. That’s best practice for testing any major changes to a site.

    Also, is there any way to pull in a custom image for each author, rather than a gravatar? Most of the authors don’t even have one set, and I don’t want to have to bother them to go online and create an account just for this. We already have images uploaded to WP, we just need a way to tell the widget which image to display. (Ideally without creating a new shortcode for each one.)

    There is definitely a way to do this.

    You’ll have to create a structure associating the uploaded image to the author.

    WP’s default does this for you but if you want a custom image for users, make sure there’s a custom image field for users to upload on so the image uploaded is associated w/ the user/author.

    If you simply upload a photo on media library, WP won’t know which user the uploaded image associated to.

    #1736078
    Ezra

    Thanks Elvin, I found this plugin which does the job admirably for custom avatars.

    Is there a way to put my widget at the end of the article, before the comments (rather than after them)?

    If you’re unsure, I highly recommend creating a making a copy of your site to a staging site so the live one doesn’t get affected. That’s best practice for testing any major changes to a site.

    Yeah, good idea. Thing is, I’m already on a staging site. 🙂

    #1736092
    Ying
    Staff
    Customer Support

    Hi there,

    Does the plugin offer shortcode? if so you can insert the short code to a hook element.
    https://docs.generatepress.com/article/hooks-element-overview/

    Set generate_before_comments_container as hook, posts > all posts as its location.

    If the plugin doesn’t offer shortcode, then you’ll need to find some plugin that can generate shortcode for the widgets.

    But I would recommend update to GPP2.0, use block element and Generateblocks to build your own author box.

    Here’s a demo video:
    https://youtu.be/HMhUo91RjsE

    #1756089
    Ezra

    Thanks so much for all your help! I ended up updating to the newest version of the GP Premium plugin and following the tutorial to create a dynamic authorbox that is hooked into the end of the article. It works great!

    #1756139
    Ying
    Staff
    Customer Support

    Nice!
    Glad to hear that 🙂

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