Skip to content

Instantly share code, notes, and snippets.

@DavidPeralvarez
Last active January 8, 2020 10:30
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 DavidPeralvarez/ba9dec25477cc8359ca936302367eb6d to your computer and use it in GitHub Desktop.
Save DavidPeralvarez/ba9dec25477cc8359ca936302367eb6d to your computer and use it in GitHub Desktop.
Solución al reto: Acciones y Filtros de Genesis
<?php
/**
* Child Theme customizations
*/
// Modify "says" in comments
add_filter( 'comment_author_says_text', 'genesis_sample_comment_author_says_text' );
function genesis_sample_comment_author_says_text( $text ){
return __( 'thinks', 'genesis-sample' );
}
// Delete tags from post meta
add_filter( 'genesis_post_meta', 'genesis_sample_post_meta' );
function genesis_sample_post_meta( $post_meta ){
return '[post_categories]';
}
// Add comments policy
add_action( 'genesis_before_comment_form', 'genesis_sample_comments_policy' );
function genesis_sample_comments_policy(){
if( comments_open() ):
?>
<div class="comment-policy-box">
<p><strong>Política de comentarios:</strong> Por favor, no seas pimpollo, está bien que te expreses líbremente, pero no ofendas a nadie con tu comentario o será fulminado con un rayo de la muerte.</p>
</div>
<?php
endif;
}
.comment-policy-box {
padding: 20px;
border: 1px solid #0073e5;
margin-bottom: 40px;
}
.comment-policy-box p {
margin-bottom: 0;
}
.comment-policy-box strong {
color: #0073e5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment