free hit counters
If you are using Internet Explorer as your browser please be running at least IE 7 or above. This site does not support IE 6 or below. Go here for the latest free version including easy download and installation instructions If you want to make it real easy on yourself, download Firefox , the most popular browser in the world. It's free and simple. You'll be so glad you did.
Jan
27
2009

Add the same image to every post

You can put an image on every post without having to insert it everytime you write a new post. You can do it with a function and hook…

In your custom_functions.php file add the following code. You can put it anywhere you want but I recommend putting it at the top after the <?php tag. Remember, once you make the change, save it, and upload it to your server. Always describe the function and put it between the comment tags /*  */ at the beginning shown below in green. The comments aren’t shown on your rendered page and it just makes things easier for you to remember…

/*image on every post*/
function name_your_function() {
echo ‘<img src=”http://your site/wp-content/themes/thesis/custom/images/your image” class=”name your class here” />’;
}
add_action(’thesis_hook_after_post’ , ‘name_your_function‘);

Name your function whatever you want

Give it a class so that you can style it in your custom.css

You can hang this function before or after a post with this…

thesis_hook_before_post

thesis_hook_after_post

Check out the hook map for placement ideas

smallhookmap

Leaving a comment with code in it...

If you would like to leave a comment and you have examples of code you want to show, you must "escape the code". This allows the entire code to show correctly by inserting certain variable around certain tags to make them show. If you don't "escape the code" your code will show up broken, mangled, and it won't be able to be seen correctly. "Escaping the code" is very simple...

  1. Copy your code you want to show
  2. Click here to go to the site to escape the code
  3. Follow the directions, it's so easy
  4. Once you have the escaped code copied, paste it in the comments area where you want
  5. Now you can enjoy life


Go ahead, leave a comment...

Leave a Comment

Previous post: Add text with styling to the mm box

Next post: Add the same image to single posts only