Created
January 31, 2012 01:23
-
-
Save GaryJones/1708031 to your computer and use it in GitHub Desktop.
Change Genesis default trackback format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'genesis_ping_list_args', 'child_ping_list_args' ); | |
| /** | |
| * Take the existing arguments, and amend one that specifies a custom callback. | |
| * | |
| * Tap into the list of arguments applied at genesis/lib/functions/comments.php. | |
| * | |
| * @see child_list_pings() Callback for displaying trackbacks. | |
| * | |
| * @author Gary Jones | |
| * @link http://code.garyjones.co.uk/change-trackback-format/ | |
| * | |
| * @param array $args Existing ping list arguments. | |
| * | |
| * @return array Amended ping list arguments. | |
| */ | |
| function child_ping_list_args( $args ) { | |
| $custom_args = array( 'callback' => 'child_list_pings' ); | |
| return array_merge( $args, $custom_args ); | |
| } | |
| /** | |
| * Echo the appearance of a single trackback. | |
| * | |
| * Code below strips away most details about the ping, and just leaves a link to | |
| * the source of the ping, with the source title as the displayed text. | |
| * | |
| * @author Gary Jones | |
| * @link http://code.garyjones.co.uk/change-trackback-format/ | |
| * | |
| * @param object $comment Comment object. | |
| * @param array $args Comment arguments. | |
| * @param integer $depth Current comment nested depth. | |
| */ | |
| function child_list_pings( $comment, $args, $depth ) { | |
| $GLOBALS['comment'] = $comment; | |
| ?> | |
| <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> | |
| <div id="comment-<?php comment_ID(); ?>"> | |
| <div class="comment-author vcard"> | |
| <?php echo get_avatar( $comment, $size = '48', $default = '<path_to_url>' ); ?> | |
| <?php printf( __( '<cite class="fn">%s</cite>' ), get_comment_author_link() ) ?> | |
| </div> | |
| </div> | |
| </li> | |
| <?php | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment