WordPress.org

Ready to get started?Download WordPress

Forums

WP Biographia
[resolved] Author Bio not displaying on Archive Pages when checked (17 posts)

  1. womensradio
    Member
    Posted 2 years ago #

    When checking the box at Settings >> WP Biographia >> Display In Archives, we're not seeing the Author Bio display on Archive pages.

    Here's a direct link as an example.

    Any help is greatly appreciated!

    -Brian & WR

    http://wordpress.org/extend/plugins/wp-biographia/

  2. vicchi
    Member
    Plugin Author

    Posted 2 years ago #

    Hi ... first of all thanks for trying out the plugin and for getting in touch. I've been wrapped up in my day job for a while so I haven't had the chance to catch up with the forums here.

    This may be down to the theme template you're using rather than the plugin itself. See http://www.vicchi.org/2011/08/31/wp-biographia-in-the-real-world/ for the full post discussing this, but the crucial part is ...

    <snip>
    Another interesting oddity is when running WP Biographia with the Biography Box configured to be displayed on Archive pages. Some themes display this fine, but for other themes the Biography Box never appears. Each time I’ve seen this it turns out to be down to the way in which the theme renders the archive page. If the theme’s archive.php uses the_content() as part of the WordPress Loop then the Biography Box appears as it should, but if the theme uses the_excerpt() as part of the Loop, then either the first 55 characters of the post or the post’s specific excerpt will be displayed. As WP Biographia appends the Biography Box to the end of each post’s content, themes which use the_excerpt() will, sadly, never display as intended when used with WP Biographia. Thankfully, this is less a shortcoming of the plugin or of the theme, it’s simply the way in which WordPress handles post excerpts.
    </snip>

    You could also try the beta of the next version of WP Biographia which, as of this morning is available for download from GitHub at https://github.com/vicchi/wp-biographia/tags. See http://www.vicchi.org/2011/11/01/wp-biographia-v2-0-goes-into-beta/ for more background and information.

    If you don't want to manually install the beta version onto your WordPress install, once beta testing is done and dusted I'll be updating the WordPress plugin repository so you can update automatically via the dashboard.

    Please have a look at your theme templates and, if you try out the v2.0 beta, let me know if this fixes the problem or if it's still there.

    Once again, thanks for using the plugin and thanks for getting in touch.

    Best

    G

  3. vicchi
    Member
    Plugin Author

    Posted 2 years ago #

    WP Biographia v2.0 is now live in the WordPress repository. But I'd recommend caution; there's been a report of some side effects with the new version (see here for details.

    I'd love to get any feedback from people who do upgrade and whether there's any other issues I don't know about, and more importantly, need to resolve.

  4. womensradio
    Member
    Posted 2 years ago #

    Just a head's up that we're still not seeing the Author Bio appear on Archive pages after updating to version 2.0.

    We use the Genesis framework by Studio Press for our parent theme with the 'Magazine' child theme enabled for further customization.

    Thx!

    -Brian & WR

  5. vicchi
    Member
    Plugin Author

    Posted 2 years ago #

    Can you possibly either post the URLs of the theme (assuming it's freely available) or drop me a mail with them. I'd like to try this out on my local install and see what the issue is on this if at all possible.

  6. womensradio
    Member
    Posted 2 years ago #

    This is a premium theme. Here are the URL's:

    Genesis: http://www.studiopress.com/themes/genesis

    Magazine Child Theme: http://themeforest.net/item/magazine-child-theme-for-genesis-framework/770585

  7. vicchi
    Member
    Plugin Author

    Posted 2 years ago #

    Hmm ... not as straightforward as I'd hoped. While I want to get this fixed, I'm not sure I'm up to shelling out nearly £40.00 to test this out, as I hope you can understand. Maybe a way forward would be for me to "borrow" the theme from you and try to duplicate your problem locally, without exposing the borrowed theme on a public facing web server?

  8. womensradio
    Member
    Posted 2 years ago #

    Thx 4 your interest in helping out Vicchi! We will query StudioPress to see if they have a fix in mind.

    Thx Again!

    -Brian & WR

  9. vicchi
    Member
    Plugin Author

    Posted 2 years ago #

    OK. Please keep me posted on what you find out as I'd like to see this through to the end. In the meantime I'll flag this as resolved and it can be re-opened if there's progress.

  10. joel19
    Member
    Posted 2 years ago #

    Hi Vicchi,

    I'm using your plugin on my blog, but the author bio box isn't displaying on the author archives page. I don't really know what the reason is. I'm using this free theme from WPShower - http://wpshower.com/themes/sight/

    Here's my author archive page - http://techolatte.com/author/Joel

  11. vicchi
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Joel,

    So I've downloaded the theme you're using and I've managed to reproduce exactly what you're seeing. This is what's happening ...

    Browsing to http://techolatte.com/author/Joel causes the theme's archive.php to be executed. This template file calls get_template_part('loop') which in turn executes loop.php. So far, so usual for most themes.

    *Most* themes either call the_content() or the_excerpt() to get the full post content or the post excerpt. Again, so far, so usual. WP Biographia works in both of these cases because it hooks into both the_content and the_excerpt filters and appends the Biography Box to either the full post content or the excerpt. If it's an excerpt, then the Biography Box will either be appended to the explicit post excerpt, if one's been written, or to the configured excerpt length, which defaults to 55 characters. So basically, providing the theme is using *standard* WordPress API calls and filters, WP Biographia should work in all cases.

    But here's where it gets interesting and, to be honest, a bit non-standard ...

    Firstly, the theme's functions.php sets a new excerpt length of 200 characters (at line 718).

    Then the theme's loop.php doesn't call the_excerpt(); instead it does this at line 23...


    <div class="post-content">
    <?php if (function_exists('smart_excerpt')) smart_excerpt(get_the_excerpt(), 55); ?>
    </div>

    ... and this is where it starts to get ... different. Having already set the excerpt length to 200 characters, loop.php then calls a theme specific function, smart_excerpt, passing in the return from get_the_excerpt(), which will have the Biography Box appended *and* a new excerpt length of 55, which this time is for *words*, not for *characters* (which does sort of make sense as I think the theme's designer wanted to ensure you actually *have* 55 words worth of excerpt).

    smart_excerpt then takes the first 55 words of the post excerpt (which will also strip off the Biography Box which has been already added) and display that as part of the archive.

    All of this is a very long winded way of saying that WP Biographia is working as it should do, and the problem lies with the theme and not with the plugin.

    There's two relatively easy workarounds for this, but both involve hacking the theme's template files.

    Workaround 1 is to remove the call to smart_excerpt entirely and rely on the WordPress excerpt handling mechanism, replacing this at line 23 of loop.php...


    <div class="post-content">
    <?php if (function_exists('smart_excerpt')) smart_excerpt(get_the_excerpt(), 55); ?>
    </div>

    ... with this ...


    <div class="post-content">
    <?php the_excerpt(); ?>
    </div>

    Workaround 2 is to call WP Biographia *again* inside smart_excerpt to add the Biography Box, but *after* the post content had been trimmed to 55 words, changing line 732 of functions.php from this ...

    echo implode(" ", array_splice($words, 0, $limit)).dots;

    ... to this ...

    echo implode(" ", array_splice($words, 0, $limit)).dots . do_shortcode('[wp_biographia mode="configured"]);

    ... hope this is of help.

    -Gary

  12. joel19
    Member
    Posted 2 years ago #

    Hi Gary,

    Thanks for your reply. I implemented the workaround 1, since workaround 2 gave me an error. However, if you view the author archive page now, the author bio box is being repeated. I mean, since it comes withing the loop, it is displayed for every post. Any solution for that.

    BTW, can you please correct the workaround 2 code? I'm getting the Parse error: syntax error, unexpected T_CLASS error

  13. vicchi
    Member
    Plugin Author

    Posted 2 years ago #

    Ack. A typo ... I missed out a single quote ...

    echo implode(" ", array_splice($words, 0, $limit)).dots . do_shortcode('[wp_biographia mode="configured"]');

    .. as the_content and the_excerpt are fired once for each post in the loop what you're seeing is expected, as you've asked for the Biography Box to be added to archive pages (which adds it to both single post archives and multiple post archives).

    If you only want a single Biography Box, there's another workaround and that's to disable the "display on archive pages" option, remove the call to smart_excerpt entirely from loop.php and add code along the lines of

    <?php echo do_shortcode ('[wp_biographia user="your-login-name"]'); ?php>

    .. outside of the WordPress loop. This will work if you have a single user blog. If you have a multi-user blog you'll need to do some cleverness to output the Biography Box at the start of the loop (so it has the current author set up) and then set a flag after the first pass through the loop so it doesn't repeat for each post.

    You'll have to do some hacking around here; I haven't been able to test this out, but in principle, it should work.

    -Gary

  14. joel19
    Member
    Posted 2 years ago #

    Well, thanks Garry. Will have a look into that.

  15. joel19
    Member
    Posted 2 years ago #

    Hi Garry,

    I managed to display the author bio by calling do_shortcode ('[wp_biographia]') before the loop within the is_author($author) condition. That is,

    <?php if(is_author($author)) { ?>
    <?php echo do_shortcode ('[wp_biographia]'); ?>
    <?php } ?>

    However, the CSS for the text within the box isn't working, but the rest of the CSS for the box (border) is working. Any idea on that?

  16. joel19
    Member
    Posted 2 years ago #

    And yes, the blog has multiple authors and the code is working for the authors as well.

  17. vicchi
    Member
    Plugin Author

    Posted 2 years ago #

    So I've just got this working on my web site; take a look at the author archive template at https://github.com/vicchi/twentyten-vicchi/blob/master/author.php.

    Basically you need to queue the first post to get the current user details setup, then you can display the Biography Box via the shortcode, then you rewind the loop and process all the posts for that author.

    -Gary

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic