Categories Site Actions X

Adding a Source Bar in WordPress

Posted on Friday, May 27th, 2011 in Uncategorized by Nick

After including the source of information for articles, I wanted to make a more permanent solution. Using a custom field and a few lines of code, you can have your own source bar on your WordPress blog.

Step 1: Create a Custom Field

When creating a new post, scroll down to custom field and add a new field called ‘source’. The value is the url to the source (ex.

Step 2: PHP

Open up single.php and find:


Add the following after it:

 $cfield = get_post_custom_values("source");
if (isset($cfield[0])) {
  echo '';

Step 3: CSS

Now open up stylesheet.css and add the following:

       border:solid 1px #dfdfdf;

I placed a demonstration at the bottom of the post

Leave a Reply

Join the forum to add your own thoughts!