WordPress.org

Forums

Author Bio Shortcode
[resolved] Cannot select author using ID (3 posts)

  1. cjmusante
    Member
    Posted 2 years ago #

    Hi,
    I know that we all say this too often, but this is another great, free plug-in that delivers great functionality, in a very simple package.

    I'm using the plug-in to display a couple of featured authors on our homepage, and when I select an author using the syntax for either username, or email address, it works perfectly well. However, when I try to select the very same author by his/her id value, the selection is ignored, and the default value overrides the selection by inserting the BIO for the page author.

    I've reviewed and compared the syntax a number of times, and I am pretty sure I've got it right. In fact, the syntax is so simple, it's hard to imagine that I've got it wrong, but here's what I've inserted...

    [author_bio name="yes" name_link="yes" id="123"]

    If I replace the value of 123 with any other value, the page is still loaded with the bio of the page owner, not of the author that I've selected.

    As mentioned, on the same page, I've inserted the short code twice, and the second shortcode is pointing to a different author, using the username syntax, and it works perfectly, as noted above.

    Can you help?
    thanks
    Cliff

    http://wordpress.org/extend/plugins/author-bio-shortcode/

  2. cjmusante
    Member
    Posted 2 years ago #

    After a week of waiting for a response, I had one of my Web Developers look into the problem, and it seems that it was a simple fix. This forum does not seem to allow me to post a new version of the PHP file as an attachment, so I'll just post the fix...

    Prior to making the change, line 59 of author-bio-shortcode.php looked like this...
    if (!empty($id) && is_int($id)){

    After making the change, line 59 of author-bio-shortcode.php looked like this...
    if (!empty($id) || is_int($id)){

    I've tested this in my system, which is running at WPEngine.com, on WP 3.5.1, and it works perfectly. The other two methods for selecting author still work, but now you can also select an author by their ID.

    I'm hopeful that the author will comment on our fix, and include it in the next version of the Plug-in.

  3. violacase
    Member
    Posted 2 years ago #

    @CJMusante
    Thanks for this very useful contribution.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Author Bio Shortcode
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags