How to add a „share this“ button to Artisteer 2.5 Theme

The latest Artisteer 2.5 included a big change in the file structure. Everything seems a bit more complicated now, but it is still easy to apply customization changes. While I am not the biggest fan of all these new social networking sites this may be different for visitors to this site and I decided to add a „share this“ button to posts and pages.


One change I’d also like to apply is to enable author and date on wordpress pages which Artisteer hides by default. Lets have a look at the file „post_metadataheader.php“:

   <?php echo $postheadericons; ?>

As you can see they call a function for the header meta data. So lets have a look at the „functions.php“:

Date and Author

Search for „function art_get_post_metadata($name)“

for($i = 0; $i < count($list_array); $i++){
$icon = $list_array[$i];
    case 'date':
        if(is_page()) break;
        $result[] = art_get_post_icon($icon) . get_the_date();
    case 'author':
         if(is_page()) break;
         $result[] = art_get_post_icon($icon) . __('Author', THEME_NS) .' '. ob_get_clean();

Delete or comment out the bold „if(is page()) break;“ lines to enable date and author on pages.

Add the Button

Now we can easily add the following code to the file „post_metadataheader.php“.

<?php echo $postheadericons; ?><?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') AND (is_singular()) ) {
} ?>

This will only show the „share this button to single posts or pages – „is_singular()“ – and not on list pages like archives, search, categories and tags.

Hope that helps!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.