Last active
September 25, 2021 08:33
-
-
Save paaljoachim/b85fd78ef1b23ccbbd45 to your computer and use it in GitHub Desktop.
Comments phrase adjustments - Genesis code snippets
This file contains 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
// 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; | |
} |
This file contains 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
// 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>'; | |
} |
This file contains 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
// 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; | |
} |
This file contains 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
// 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'); |
This file contains 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
// 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