From d774e98d34813a1c1c103f918b4468b1ba1c14f4 Mon Sep 17 00:00:00 2001 From: ulaulaman Date: Wed, 30 Jun 2021 10:37:43 +0200 Subject: [PATCH] Modifiche minori e per risoluzione issue --- sidebars/brera.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sidebars/brera.php b/sidebars/brera.php index 5cf070d..c10f675 100644 --- a/sidebars/brera.php +++ b/sidebars/brera.php @@ -7,7 +7,8 @@ add_shortcode( 'sbcorsobase', function () { $logo = '

'; $autore = do_shortcode('[blog-post-coauthors]'); - + $autore = '

Lezione a cura di: '.$autore.'

'; + $breraNav = wp_get_nav_menu_items(1682); foreach ( $breraNav as $navItem ) { @@ -17,20 +18,20 @@ add_shortcode( 'sbcorsobase', function () { $menu = '
'.$nav.'
'; $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; + if ( empty($custom) ) { + $capitolo = null; + } else { + 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; + $sidebar = $logo.$autore.$capitolo.$menu; - return $out; + return $sidebar; } ); \ No newline at end of file