Last active
June 26, 2020 22:21
-
-
Save studiopress/5708140 to your computer and use it in GitHub Desktop.
Genesis comments.
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Add a comment policy box in comments | |
add_action( 'genesis_after_comments', 'sp_comment_policy' ); | |
function sp_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>Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.</small></p> | |
</div> | |
<?php | |
} | |
} |
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Modify the comment link text in comments | |
add_filter( 'genesis_post_info', 'sp_post_info_filter' ); | |
function sp_post_info_filter( $post_info ) { | |
return '[post_comments zero="Leave a Comment" one="1 Comment" more="% Comments"]'; | |
} |
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Modify comments title text in comments | |
add_filter( 'genesis_title_comments', 'sp_genesis_title_comments' ); | |
function sp_genesis_title_comments() { | |
$title = '<h3>Discussion</h3>'; | |
return $title; | |
} |
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Modify the size of the Gravatar in comments | |
add_filter( 'genesis_comment_list_args', 'sp_comments_gravatar' ); | |
function sp_comments_gravatar( $args ) { | |
$args['avatar_size'] = 96; | |
return $args; | |
} |
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Modify the speak your mind title in comments | |
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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Modify trackbacks title in comments | |
add_filter( 'genesis_title_pings', 'sp_title_pings' ); | |
function sp_title_pings() { | |
echo '<h3>Trackbacks</h3>'; | |
} |
Another code to add:
/* Customize the post meta function below the post AND remove it from category pages
http://wordpress.stackexchange.com/questions/50961/removing-post-meta-from-category-pages */
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' );
function sp_post_meta_filter($post_meta) {
if ( !is_page() ) {
if (is_category() ) $post_meta = '';
else $post_meta = '[post_categories before="Categories: "] [post_tags before="Tagged: "]';
return $post_meta;
}}
Any way to hide the label "Post Author" or Change that for anything else?
Thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Regarding comments-link.php. As one uses the code it will then remove the author and date. I included a rewrite to include them.
/* 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;
}