A Great Idea from the Thesis Forum
Browsing through the Thesis Forum recently, I came across a forum thread about a custom function before the headline hook.
The following instructions are from that forum thread, based on my usage of it at www.Bully.ws which we recently retired to spend more time on our other blogs.
If the code is not working for you, please post your request for help at this forum thread.
Adding an image to before your posts is great for branding, visual excitement and integrating your logo colours throughout your site without making it too busy.
Add an image before your headlines in Easy Steps
- Make an image (I use 50px x 50px) and save it to your ‘themes/thesis/images’ folder
- Grab hold of IrfanView – a great free program that lets you resize and change format, crop, etc.
- Copy and paste the code below – don’t forget to alter the url of the image location – into your custom functions.php and custom.css files
- Refresh your browser and see your creation
Add the following to your custom functions.php file
/*avatar before headline site wide*/
function author_avatar() {
echo ‘<img src=”http:/thesisthemehq.com/wp-content/themes/thesis/images/ChamEye.gif” alt=” ” class=”title-avatar” />’;
}
add_action(‘thesis_hook_before_headline’, ‘author_avatar’);
Add the following to your custom.css file
/*—:[ #avatar before header ]:—*/
.custom .title-avatar {
float:left;
margin: 0 1em 0 0;}
If you just want it to appear on your pages (when reader is only reading that article)
Add the following to your customs function.php file
/*the following puts avatar before each post on pages only*/
function author_avatar() {
if (is_page()){
}
else{ ?>
<img src=”http://bully.ws/wp-content/themes/thesis/images/bull.gif” alt=” ” class= “title-avatar” />
<?php
}}
add_action(‘thesis_hook_before_headline’, ‘author_avatar’);
And the following to your custom.css file
/*—:[ #avatar before header ]:—*/
.custom .title-avatar {
float:left;
margin: 0 1em 0 0;}
Show Off Your Site
If you are using this customisation, let us know by leaving a comment with your site url.
Here are some sites using it already.
www.bully.ws
www.redrightreturning.net
www.howtomakemyblog.com


Subscribe




{ 6 comments… read them below or add one }
Would you be kind enough to explain to a “newbie” how to do this with the openhook plugin?
I just installed two days ago & miss the avatar I used before my title in my old theme. Thank you!
This Eclectic Life’s latest artistic creation..St. Peter’s Catholic Church in Lindsay, Texas. My Neck Of The Woods
Thanks.
“A Great Idea from the Thesis Forum” really great)
100 Top Films
Imdb´s last blog ..Wildboyz (2003) [Adventure, Comedy, Documentary], s04e07
A big thank you for this very effective addition.
:o)
At last i find it!!! Thanks, i was looking for this trick for my blog Http://www.arquigrafico.com
I love thesis!!!!!!!!!!!!!
ARQUIGRAFICO´s last blog ..Como hacer textura de agua en una Piscina con Vray y 3dsmax
I did it, but it did not work.
I had some errors with the simbols
/*— and
”http:// ……
What could happen?
Arquigrafico´s last blog ..Los mejores programas de edicion de imagenes
When you copy the code you sometimes need to paste it into a text editor and change the ‘ and ” because they change. Check the code via the custom-functions viewer in the dashboard or via the cpanel if you can and see what code ended up saving as.