Comments phrase adjustments - Genesis code snippets
// Add or remove notes after the comment box | |
// | |
add_filter( 'comment_form_defaults', 'sp_remove_comment_form_allowed_tags' ); | |
function sp_remove_comment_form_allowed_tags( $defaults ) { | |
$defaults['comment_notes_after'] = 'An extra comment'; | |
return $defaults; | |
} |
// Modify the Genesis content limit read more link - Genesis Settings page - Display post content certain amount of characters. I selected 200. | |
// | |
add_filter( 'get_the_content_more_link', 'sp_read_more_link' ); | |
function sp_read_more_link() { | |
return '... <a class="more-link" href="' . get_permalink() . '">[Read on]</a>'; | |
} |
// Modify the speak your mind title in comments - Comment Box title - | |
// | |
add_filter( 'comment_form_defaults', 'sp_comment_form_defaults' ); | |
function sp_comment_form_defaults( $defaults ) { | |
$defaults['title_reply'] = __( 'Leave a Comment' ); | |
return $defaults; | |
} |
// Changing the mini Comment title to something else http://wpsites.net/web-design/customize-comment-field-text-area-label/ | |
// | |
function wpsites_modify_comment_form_text_area($arg) { | |
$arg['comment_field'] = '<p class="comment-form-comment"><label for="comment">' . _x( 'Your feedback is appreciated!', 'noun' ) . '</label><textarea id="comment" name="comment" cols="55" rows="7" aria-required="true"></textarea></p>'; | |
return $arg; | |
} | |
add_filter('comment_form_defaults', 'wpsites_modify_comment_form_text_area'); |
// Thanks to Jo at http://www.jowaltham.com/customising-comment-date-genesis/ | |
// In reply: Remove time and link inside the date field. | |
// | |
add_filter( 'genesis_show_comment_date', 'jmw_remove_comment_time_and_link' ); | |
function jmw_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 | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment