diff --git a/backupsnippet/snippet.php b/backupsnippet/snippet.php index 9093789..dc71ff0 100644 --- a/backupsnippet/snippet.php +++ b/backupsnippet/snippet.php @@ -351,3 +351,79 @@ add_action( 'widgets_init', 'register_pcto' ); function register_pcto() { register_widget( 'Widget_PCTO' ); } + +#menu didattica +add_shortcode( 'menudidattica', function () { + + $astrodid = ''; + $corsi = ''; + $schede = ''; + $corso = ''; + $inclusione = ''; + $tink = ''; + + $menu = '
'.$astrodid.$inclusione.$tink.$corso.$schede.$corsi.'
'; + + $out = $menu; + + return $out; +} ); + +#ultimo aggiornamento +function wpb_last_updated_date( $content ) { +$u_time = get_the_time('U'); +$u_modified_time = get_the_modified_time('U'); +if ($u_modified_time >= $u_time + 86400) { +$updated_date = get_the_modified_time('j F Y'); +$updated_time = get_the_modified_time('h:i a'); +$custom_content .= '

Ultimo aggiornamento il '. $updated_date . ' alle '. $updated_time .'

'; +} + + $custom_content .= $content; + + if ( get_post_type() <> 'page' ){ + return $custom_content; + } else { + return $content; + } +} +add_filter( 'the_content', 'wpb_last_updated_date' ); + +#sidebar corso brera +add_shortcode( 'sbcorsobase', function () { + + $logo = '

'; + + $autore = do_shortcode('[blog-post-coauthors]'); + + $intro = ''; + $cap1 = ''; + $cap2 = ''; + $cap3 = ''; + $cap4 = ''; + $cap5 = ''; + $cap6 = ''; + $cap7 = ''; + $cap8 = ''; + $cap9 = ''; + + $menu = '
'.$intro.$cap1.$cap2.$cap3.$cap4.$cap5.$cap6.$cap7.$cap8.$cap9.'
'; + + $custom = get_post_custom(); + foreach( $custom as $key => $value ) { + $key_name = get_post_custom_values( $key = 'pdfcap' ); + if ( $key_name[0] <> null ) { + $capitolo = '

Scarica la lezione in pdf

'; + } else { + $capitolo = null; + } + } + + $cap = '

Lezione a cura di: '.$autore.'

'; + + $sidebar = $logo.$cap.$capitolo.$menu; + + $out = $sidebar; + + return $out; +} );