Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Highlight Guest Blog Post Author

  1. #1
    Jeffro's Avatar
    Jeffro is offline WPTavern Forum Admin
    Join Date
    Jan 2009
    Location
    Ohio
    Posts
    2,358

    Icon5 Highlight Guest Blog Post Author

    As I receive more guest posts for WPTavern I would like a better way to highlight the author of that post, something to distinguish it amongst the other content, like a block quote. I'm thinking this could be a plugin but I'm also thinking it could be as simple as adding a Guest Blog Author class to my child themes CSS file and just wrapping text in that specific class when I publish a guest blog post.

    I'd love for the guest author block to have a way to feature an authors Gravatar as well. And this should all be capable without them having an account with the site.

    What do you guys and gals think in terms of the best approach or the easiest way to do this? I couldn't find a plugin that does this.

  2. #2
    andrew is offline Hello World
    Join Date
    Jan 2009
    Location
    Huddersfield, West Yorkshire
    Posts
    70

    Default

    Create a page for each guest author that includes the content you want. You can quite easily add their gravatar manually. Name it something like Guest Author - John Smith.

    Use a custom field (or a plugin that creates a special box) to name the author.

    Have the theme retrieve the guest author page based on the entry in the custom field; i.e. retrieve the page with the name Guest Author - {custom field}, using get_page.

    It would be easy to write this into a plugin. I will do that for you if you want to do it that way.

  3. #3
    itsananderson's Avatar
    itsananderson is offline Big Tipper
    Join Date
    Jan 2009
    Location
    Terre Haute, IN
    Posts
    354

    Default

    You could also use short codes rather than custom fields. Similar to Andrew's suggestion about creating pages (which should be private by the way, so they don't explicitly show up in your page structure). Then when you put something like [guest name="John Smith"] into a post, it can be replaced by the John Smith guest author page contents. The advantage of this method is that you can place the author information anywhere in the post you want. The disadvantage is that finding all posts by a specific guest author is harder. If you want to do it this way, I could probably throw together the shortcode parser in around 20 minutes.

    For the gravatars, this plugin might be useful. It registers a shortcode so you can type [gravatar email="email@gmail.com"] to get the gravatar for that email. Pretty slick if you ask me.

    http://dentedreality.com.au/projects...tar-shortcode/

  4. #4
    andrew is offline Hello World
    Join Date
    Jan 2009
    Location
    Huddersfield, West Yorkshire
    Posts
    70

    Default

    Quote Originally Posted by itsananderson View Post
    You could also use short codes
    Excellent suggestion. Also good point about private pages.

  5. #5
    Jeffro's Avatar
    Jeffro is offline WPTavern Forum Admin
    Join Date
    Jan 2009
    Location
    Ohio
    Posts
    2,358

    Default

    I guess I should have published an example. Take a look at this one. Click on the image for a bigger view.

    guestpost.png

    I want something like that I can call upon either with a shortcode or whatever which highlights the guest blog post author.

  6. #6
    bradgillap's Avatar
    bradgillap is offline Hello World
    Join Date
    Apr 2009
    Location
    Welland, Ontario, Canada
    Posts
    28

    Default

    Offtopic: Jeffro I have my guest post ready. It's sitting in my wordpress as a draft at the moment. How do you like guest post content submitted?

  7. #7
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,797

    Default

    Why not just add the extra box directly into the post? It wouldn't require any plugin or theme modifications beyond a little CSS to style that particular block which would include an extra wrapper class to style it differently from the other sections.

    It would also degrade gracefully if you decided not to use it in the future as it would simply lose the CSS required for it.

  8. #8
    Jeffro's Avatar
    Jeffro is offline WPTavern Forum Admin
    Join Date
    Jan 2009
    Location
    Ohio
    Posts
    2,358

    Default

    Quote Originally Posted by Ryan View Post
    Why not just add the extra box directly into the post? It wouldn't require any plugin or theme modifications beyond a little CSS to style that particular block which would include an extra wrapper class to style it differently from the other sections.

    It would also degrade gracefully if you decided not to use it in the future as it would simply lose the CSS required for it.

    Thats what my original plan was. Would I simply add a special class to the child themes CSS file and then wrap the content within that class in the post? I was hoping to find a code snippet of a box already in action but maybe I'll dig into the code on that example I showed and modify it for my own purposes. However, what would be a good way to put someones gravatar into this box? A gravatar function call or something? Would like to load a gravatar based on that persons gravatar email or md5 hash.

  9. #9
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,797

    Default

    You don't need to do anything fancy to show someones gravatar, just find it somewhere on the web and copy the URL for it.

    You would do it something like this:
    Code:
    <div class="guestposter">
    bla bla bla discussion about me ...
    a href="http://pixopoint.com/" rel="external nofollow" title="Ryan"><img alt='Ryan' src='http://www.gravatar.com/avatar/a084125c824d274ff40cb834cf9f544a?s=80&amp;d=identicon&amp;r=R' height='80' width='80' /></a>
    </div>
    And you would have CSS to go with it:
    Code:
    .guestposter {background:grey;border:1px solid #666;}
    .guestposter img {float:right;border:1px solid #ccc;}

  10. #10
    johnkolbert is offline Hello World
    Join Date
    Jan 2009
    Location
    USA
    Posts
    11

    Default Plugin

    A client hired me to do almost exactly this a few months ago. It was a plugin that added a textbox to the user profile section. Here the author (or admin) could enter biographical data. They could also upload an image to be used (though using a gravatar would be even easier). Then the info was automatically displayed at the end of each post with the authors info, styled via CSS and HTML.

    Unfortunately since it was a hired gig I can't just post the plugin without his permission. But is that along the lines of what you were thinking?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •