Featuring Your Blog’s Guest Authors

99bf1b023895927bc753c70dc1420c89 0 Del.icio.us

Here’s the code that I mention in the video. Simply open your WordPress template’s file named ‘single.php‘ and paste this code just above ‘the_content‘ tag. Be sure to modify those three pieces of code that we discuss in the video so that it properly reflects you and your website.

<?php $author="Nicholas Cardot"; if(get_the_author()!=$author): ?><p><i>This is a guest post by <?php the_author(); ?>. If you&#39;re interested in getting yourself in front of the readers of Site Sketch 101, <a href="http://www.sitesketch101.com/site-sketch-101-wants-you">check out the guest posting guidelines here.</a></i></p><?php endif; ?>

If you have questions, comments or if you need any help then please don’t hesitate to use the comments section of this post.

Share your Opinion

and be a part of the discussion.

  1. Name (required)

    Mail (required)

    Website
    Your Comment

19 Vibrant Comments

I would love to hear yours!


  1. January 10, 2010

    Eric B. said:

    This is a very useful snippet. If you have multiple “official” authors, you could use an array to store their names:

    $authors = array(
        'Author One',
        'Author Two',
        'Author Three',
    );
    

    And then just change the if statement to

    if (!in_array(get_the_author(), $authors):
    

    I think you’re missing a semicolon at the end of your endif statement. I don’t know if that still works, but I’ve gotten syntax errors for similar things. (I’d include it, just to be safe)
    My Latest Blog Post: CSS Hanging Quotation Marks


  2. January 10, 2010

    Deepika said:

    I was searching for this.. Thanks for informing about this. I will try this and inform you..
    My Latest Blog Post: Contest @FamousBloggers: Win Prizes worth $500


  3. January 10, 2010

    Karl Foxley said:

    Great tutorial and was just what I was looking for. Thanks Eric B. for adding the multi author section because you’ve saved me having to ask that now. :)

    Regards,

    Karl
    My Latest Blog Post: Have You Seen The Brand New OnTheGo Theme?


  4. January 11, 2010

    Don Gilbert said:

    I recently read something similar to this over at wmpu.org. However, it was for showing the entire blogger profile at the bottom of every post on your blog.

    I don’t have guest bloggers yet, but I will add this to my site with high hopes. :P
    My Latest Blog Post: Top 10 Tips to Dominate Your Niche for SEO


  5. January 11, 2010

    Lee Ka Hoong said:

    That’s new to me. I do have guest bloggers for my blog and I add all the thing manually in every guest post I received.

    Thanks for sharing the tutorial, and thanks Eric for adding valuable details!

    Cheers,
    Lee


    • January 11, 2010

      Nicholas Cardot said:

      Lee Ka Hoong » I’m glad you find it useful. I just put it to work on the site here and I figured that others might benefit from the information as well.


      • January 28, 2010

        Derek Jensen said:

        I just added it to my site too because it makes anyone wanting to write a guest post happy.

        The key thing to do in that first sentence or two is how are you going to attract more guest posts? You need to be unique and let it reflect your overall blog ‘style’.


  6. January 19, 2010

    Terry | Charter Title Company said:

    Nice, i was wondering about this for my blog. I love this resource. I’m just getting started but want to thank Nicholas.


  7. February 1, 2010

    Ron Leyba said:

    I’m not into programming or PHPing, but I think learning some basic things is essential so I can implement this code up on my site. I am planning to have a collaboration site wherein my writers will be scattered all over out province. With this code, the post they will make will be well organized and they will be give proper credits as well.
    My Latest Blog Post: Sikat Ang Pinoy


  8. February 25, 2010

    Matt Stratton said:

    Wow, what a great tip! I usually try to remember to put in a slug like that for guest posts, but I don’t always remember…and of course, they’re not standardized. Brilliant suggestion.
    My Latest Blog Post: Team management with OneNote