Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Highlight Guest Blog Post Author

  1. #11
    Soean's Avatar
    Soean is offline Hello World
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    4

    Default

    My Idea is to write a simple plugin. The info-text you can save in the author description and upload an Image with the ID of the User in the Theme folder.

    PHP Code:
    <?php
    $guest 
    = <<<EOF
    <div class="guestposter">
    <?php the_author_description(); ?> 
    <img alt="<?php the_author(); ?>" src="<?php bloginfo('stylesheet_url'); ?>/guestposter/<?php the_author_ID(); ?>.jpg">
    </div>
    EOF;

    <?
    php if(the_author_ID() != 1
     {
      echo 
    $guest;
     }
    ?>
    And just a litte CSS like Ryan has posted.

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

    Default

    Quote Originally Posted by johnkolbert View Post
    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?
    Quote Originally Posted by Soean View Post
    My Idea is to write a simple plugin. The info-text you can save in the author description and upload an Image with the ID of the User in the Theme folder.

    PHP Code:
    <?php
    $guest 
    = <<<EOF
    <div class="guestposter">
    <?php the_author_description(); ?> 
    <img alt="<?php the_author(); ?>" src="<?php bloginfo('stylesheet_url'); ?>/guestposter/<?php the_author_ID(); ?>.jpg">
    </div>
    EOF;

    <?
    php if(the_author_ID() != 1
     {
      echo 
    $guest;
     }
    ?>
    And just a litte CSS like Ryan has posted.
    Would both of these methods require that the end user have a registered account on the site? If so, that won't work because I don't want to register them. Just publish a little info about them, showcase their gravatar or some other image and have that info in a styled box that is different than the content.

  3. #13
    Soean's Avatar
    Soean is offline Hello World
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    4

    Default

    Ah ok, then I think the Idea of Ryan is the most practical.

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

    Default

    My idea is certainly the easiest to implement.

    You could do something like John Kolbert's approach but not directly connected to the WP user system, but that would be a lot of extra work just to save typing a start tag, end tag and an IMG tag with the users gravatar in it.

    Once you had my idea implemented once, it would just be a matter of copy and pasting it into each new post. And the system would always work, it wouldn't stop working just because WordPress updated something in core. Even if you removed the CSS, the text would still be there, just not styled differently from the rest of the post.

    If you figure out what you want it to look like, we can paste some CSS here which you could place in your theme to implement this idea straightaway if you want.

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

    Default

    I'm going to play around with the code you provided Ryan and use the blockquote styling as my base for the guestauthor class. I should be able to get something out of that.

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

    Default

    So the other day, I messed around with Ryans code and some of my own and came up with a stylish way to highly the guest author. I have a guest post being published later today in the evening where you'll see it in action.

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

    Default

    I'm surprised no one mentioned a plugin Andrew Rickmann made which I found buried in the repository:

    http://wordpress.org/extend/plugins/...h-guest-posts/

    Not sure if it would do what I'm doing but it's cool someone though of it.

Page 2 of 2 FirstFirst 12

Posting Permissions

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