Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / trackbacks-headlines.php
Created Jun 28, 2017
Modify Trackbacks Headline text in Genesis
View trackbacks-headlines.php
//* 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 Jun 28, 2017
Modify Submit Button in Genesis
View comment-submit-button.php
//* 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 Jun 28, 2017
Add A Comment Policy Box in Genesis
View comment-policy.php
//* 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 Jun 28, 2017
Removed Allowed Tags in Genesis
View remove-allowed-tags.php
//* 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 Jun 28, 2017
Modify Leave a Reply in Genesis
View leave-a-reply.php
//* 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 Jun 28, 2017
Remove Comment Time & Link Inside the Date Field in Genesis
View comment-time-date.php
// 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 Jun 28, 2017
Modify the Comment Gravatar Size in Genesis
View comment-gravatar.php
//* 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 Jun 28, 2017
Modify the Comments Headline Text in Genesis
View comments-headline-text.php
//* 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 Aug 6, 2017
Add or remove notes after the comment box in Genesis
View notes-after-comment-box.php
// 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 Jun 29, 2017
Display Related Posts in Grid Format in Genesis
View related-grid-genesis.php