Skip to content

Instantly share code, notes, and snippets.

@paaljoachim
Last active September 25, 2021 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paaljoachim/b85fd78ef1b23ccbbd45 to your computer and use it in GitHub Desktop.
Save paaljoachim/b85fd78ef1b23ccbbd45 to your computer and use it in GitHub Desktop.
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');
// Adjust post meta in entry header AND change comments text in comments button
// http://wpspeak.com/remove-post-date-in-genesis-framework/
//
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter($post_info) {
$post_info = '[post_date] By [post_author_posts_link] [post_comments zero="Add a Comment" one="1 Comment" more="% Comments"] [post_edit]';
return $post_info;
}
// Customize the submit button text in comments https://gist.github.com/studiopress/5708140
//
add_filter( 'comment_form_defaults', 'sp_comment_submit_button' );
function sp_comment_submit_button( $defaults ) {
$defaults['label_submit'] = __( 'Submit', 'custom' );
return $defaults;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment