Genesis Code Snippets

Genesis Code Snippets

Genesis Code Snippets – By StudioPress !

Salvo diversa indicazione, i frammenti di codice che vedete qui sotto devono essere inseriti nel file functions.php del vostro genesis child theme. Ricordatevi, però, di eseguire prima il backup del file functions.php, per poterlo ripristinare in caso di problemi.

Modificare il titolo “About” del Box Autore

//* Customize the author box title
add_filter( 'genesis_author_box_title', 'custom_author_box_title' );
function custom_author_box_title() {
return 'Scrivere qui il vostro nuovo titolo';

Modificare le dimensioni dell’immagine Gravatar nel box autore

//* Modify the size of the Gravatar in the author box
add_filter( 'genesis_author_box_gravatar_size', 'author_box_gravatar_size' );
function author_box_gravatar_size( $size ) {
return '80';

Visualizzare un Gravatar personalizzato

//* Display a custom Gravatar
add_filter( 'avatar_defaults', 'sp_gravatar' );
function sp_gravatar ($avatar) {
$custom_avatar = get_stylesheet_directory_uri() . '/images/gravatar.png';
$avatar[$custom_avatar] = "Custom Gravatar";
return $avatar;

Modificare il testo “the author says text” nei commenti

//* Modify the author says text in comments
add_filter( 'comment_author_says_text', 'sp_comment_author_says_text' );
function sp_comment_author_says_text() {
return 'Scrivere qui il nuovo testo';

Modificare il testo “Discussion” nei commenti

//* Modify comments title text in comments
add_filter( 'genesis_title_comments', 'sp_genesis_title_comments' );
function sp_genesis_title_comments() {
$title = '<h3>Qui la modifica</h3>';
return $title;

Modificare il testo “Leave a Comment”

//* 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'] = __( 'Qui la modifica' );
return $defaults;}

Modificare il testo del pulsante “Submit”

//* Customize the submit button text in comments
add_filter( 'comment_form_defaults', 'sp_comment_submit_button' );
function sp_comment_submit_button( $defaults ) {$defaults['label_submit'] = __( 'Qui la modifica', 'custom' );
return $defaults;}

Aggiungere una “Policy Box” nei commenti

//* 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>Scrivete qui la vostra privacy Policy.</small></p>

Personalizzare il testo “Credits” nel il piè di pagina (footer)

//* Change the footer text
add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
function sp_footer_creds_filter( $creds ) {
$creds = '[footer_copyright] &middot; <a href=""> Link</a> &middot; By <a href="" title="Genesis Framework">Genesis Framework</a>';
return $creds;

Genesis Search Form – modificare il testo “Search my blog…”

//* Customize search form input box text
add_filter( 'genesis_search_text', 'sp_search_text' );
function sp_search_text( $text ) {
return esc_attr( 'Cerca nel blog...' );

Fonte ufficiale

Link utili

  1. jeanphilippemarchand
  2. wpbeaches
  3. robincornett

Our website uses cookies and thereby collects information about your visit to improve our website (by analyzing), show you Social Media content and relevant advertisements. Please see our cookies page for furher details or agree by clicking the 'Accept' button.

Cookie settings

Below you can choose which kind of cookies you allow on this website. Click on the "Save cookie settings" button to apply your choice.

FunctionalOur website uses functional cookies. These cookies are necessary to let our website work.

AnalyticalOur website uses analytical cookies to make it possible to analyze our website and optimize for the purpose of a.o. the usability.

Social mediaOur website places social media cookies to show you 3rd party content like YouTube and FaceBook. These cookies may track your personal data.

AdvertisingOur website places advertising cookies to show you 3rd party advertisements based on your interests. These cookies may track your personal data.

OtherOur website places 3rd party cookies from other 3rd party services which aren't Analytical, Social media or Advertising.