Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / trackbacks-headlines.php
Created June 28, 2017 06:57
Modify Trackbacks Headline text in Genesis
//* Modify trackbacks title in comments
add_filter( 'genesis_title_pings', 'topleague_title_pings' );
function topleague_title_pings() {
echo '<h3>Trackbacks</h3>';
}
@topleague
topleague / comment-submit-button.php
Last active June 28, 2017 08:49
Modify Submit Button in Genesis
//* Customize the submit button text in comments
add_filter( 'comment_form_defaults', 'topleague_comment_submit_button' );
function topleague_comment_submit_button( $defaults ) {
$defaults['label_submit'] = __( 'Post Comment');
return $defaults;
}
@topleague
topleague / comment-policy.php
Created June 28, 2017 07:10
Add A Comment Policy Box in Genesis
//* Add a comment policy box in comments
add_action( 'genesis_after_comments', 'topleague_comment_policy' );
function topleague_comment_policy() {
if ( is_single() && !is_user_logged_in() && comments_open() ) {
?>
<div class="comment-policy-box">
<p class="comment-policy"><small><strong>Comment Policy:</strong>Zero tolerance for spammy comments.</small></p>
</div>
<?php
}
@topleague
topleague / remove-allowed-tags.php
Created June 28, 2017 07:13
Removed Allowed Tags in Genesis
//* Remove comment form allowed tags
add_filter( 'comment_form_defaults', 'topleague_remove_comment_form_allowed_tags' );
function topleague_remove_comment_form_allowed_tags( $defaults ) {
$defaults['comment_notes_after'] = '';
return $defaults;
}
@topleague
topleague / leave-a-reply.php
Created June 28, 2017 07:19
Modify Leave a Reply in Genesis
//* Modify the 'Leave a Reply' title in comments
add_filter( 'comment_form_defaults', 'topleague_comment_form_defaults' );
function topleague_comment_form_defaults( $defaults ) {
$defaults['title_reply'] = __( 'Share Your Thoughts' );
return $defaults;
}
@topleague
topleague / comment-time-date.php
Created June 28, 2017 07:27
Remove Comment Time & Link Inside the Date Field in Genesis
// Remove Comment Time & Link Inside the Date Field in Genesis (h/t: http://www.jowaltham.com/customising-comment-date-genesis/)
add_filter( 'genesis_show_comment_date', 'topleague_remove_comment_time_and_link' );
function topleague_remove_comment_time_and_link( $comment_date ) {
printf( '<p %s>', genesis_attr( 'comment-meta' ) );
printf( '<time %s>', genesis_attr( 'comment-time' ) );
echo esc_html( get_comment_date() );
echo '</time></p>';
// Return false so that the parent function doesn't also output the comment date and time
@topleague
topleague / comment-gravatar.php
Last active June 28, 2017 08:59
Modify the Comment Gravatar Size in Genesis
//* Modify the size of the Gravatar in comments
add_filter( 'genesis_comment_list_args', 'topleague_comments_gravatar' );
function topleague_comments_gravatar( $args ) {
$args['avatar_size'] = 96; // change the number depending on your requirement
return $args;
}
@topleague
topleague / comments-headline-text.php
Created June 28, 2017 07:42
Modify the Comments Headline Text in Genesis
//* Modify comments title text in comments
add_filter( 'genesis_title_comments', 'topleague_genesis_title_comments' );
function topleague_genesis_title_comments() {
$title = '<h3>What They Say</h3>';
return $title;
}
@topleague
topleague / notes-after-comment-box.php
Last active August 6, 2017 08:37
Add or remove notes after the comment box in Genesis
// Add or remove notes after the comment box
add_filter( 'comment_form_defaults', 'topleague_remove_comment_form_allowed_tags' );
function topleague_remove_comment_form_allowed_tags( $defaults ) {
$defaults['comment_notes_after'] = 'Enter the Following Details';
return $defaults;
}
@topleague
topleague / related-grid-genesis.php
Created June 29, 2017 14:48
Display Related Posts in Grid Format in Genesis