Thesis Hook Example 4: Adding the Social Profiles Plugin
If you’re using the Social Profiles plugin we created here at Sugarrae, the following code will show you how to get the plugin output to appear in your comments area in the same way they appear in mine (after the author’s name, the date, etc but before the comment).
Step 1: upload and activate the Social Profiles plugin
Step 2: Open your custom_functions.php file (thesis > custom > custom_functions.php) in your favorite editor
Step 3: Underneath the example code already in the file, place the following code:
/* Custom Social Profiles for Comments Addition */
function add_social_profiles () {
global $comment;
?>
<?php cyc2_show_profiles($comment->user_id); ?>
<?php
}
add_action('thesis_hook_after_comment_meta', 'add_social_profiles');
Per usual, the /* Stuff Inside Here */ is a label for the code below so you know what it is at a single glance. This is not part of the actual “code”. The word “function” tells Thesis you want it to do something. The add_social_profiles is what I decided to name that function.
The PHP code for the plugin is added and then the add_action(‘thesis_hook_after_comment_meta’, ‘add_social_profiles’); line tells Thesis you want to add a function to the thesis_hook_after_comment_meta (the hook that creates the name, date, number, etc of commenters) and the function you want to add is the one we created – add_social_profiles.
No comments:
Post a Comment