Altre funzioni utili

/*—–DISABILITA ADMIN BAR PER TUTTI GLI UTENTI DEL CORRENTE THEME —–*/

// disable the admin bar
show_admin_bar(false);

 


/*redirect dopo registrazione*/

function __my_registration_redirect(){

return home_url( ‘/my-page’ );

}

add_filter( ‘registration_redirect’, ‘__my_registration_redirect’ );

 


/*Log-in / out shortcode function*/

if ( ! function_exists(‘wpex_loginout_shortcode’) ) {

function wpex_loginout_shortcode( $atts ) {

extract( shortcode_atts( array(

‘login_url’ => wp_login_url(),

‘log_in_text’ => __( ‘log in’, ‘wpex’ ),

‘log_out_text’ => __( ‘log out’, ‘wpex’ ),

), $atts ) );

if ( is_user_logged_in() ) {

$url = wp_logout_url( home_url() );

return ‘<a href=”‘. $url .'” title=”‘. $log_out_text .'”>’. $log_out_text .'</a>’;

} else {

$url = $login_url;

return ‘<a href=”‘. $url .'” title=”‘. $log_in_text .'”>’. $log_in_text .'</a>’;

}

}

add_shortcode( ‘loginout-link’, ‘wpex_loginout_shortcode’ );

}

 


/*limitare il numero di revisioni per gli articoli:*/

define(‘WP_POST_REVISIONS’, 10); // Salva al massimo 10 revisioni per articolo

 


/*Personalizza il titolo del modulo commenti*/

function wpbeginner_comment_text_after($arg) {

$arg[‘comment_notes_after’] = “Your text here.”;

return $arg; }

add_filter(‘comment_form_defaults’, ‘wpbeginner_comment_text_after’);

 


/*evidenziare le risposte dell’autore dai commenti degli utenti:*/

.bypostauthor { background: #eee; }

 


/*PERSONALIZZA LOGIN*/

function my_login_logo() { ?>

<style type=”text/css”>

body{

background: #070419;

}

#login h1 a, .login h1 a {

background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/Tia_rilievo3.png);

height:65px;

width:320px;

background-size: 320px 65px;

background-repeat: no-repeat;

padding-bottom: 30px;

}

.login form{

background: #ccf;

}

.login p a{

background: #ccf;

font-size: 16px;

padding: 5px;

}

</style>

<?php }

add_action( ‘login_enqueue_scripts’, ‘my_login_logo’ );

 

/* ———————————- CAMBIA link LOGO LOGIN  —————————- */

function cambia_url_logo(){

echo bloginfo(‘http://www.tiade.it’);  // homepage del sito

}

add_filter(‘login_headerurl’, ‘http://www.tiade.it’);

function cambia_title_login(){

echo “Tiade”; // Cambia con quello che vuoi

}

add_filter(‘login_headertitle’, ‘cambia_title_login’);

 


 

INDICE