From c3c024b7be65dfa0fb5126c77209b8b9acc18d8e Mon Sep 17 00:00:00 2001 From: ulaulaman Date: Fri, 13 Nov 2020 02:56:37 +0100 Subject: [PATCH] Backup code snippet --- backupsnippet/snippet.php | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/backupsnippet/snippet.php b/backupsnippet/snippet.php index dc71ff0..48e2360 100644 --- a/backupsnippet/snippet.php +++ b/backupsnippet/snippet.php @@ -427,3 +427,44 @@ add_shortcode( 'sbcorsobase', function () { return $out; } ); + +#sidebar astroschede +add_shortcode( 'sbastroscheda', function () { + + $custom = get_post_custom(); + foreach( $custom as $key => $value ) { + $key_name = get_post_custom_values( $key = 'urlfoto' ); + if ( $key_name[0] <> null ) { + $foto1 = '

'; + } else { $foto1 = null; } + if ( $key_name[1] <> null ) { + $foto2 = '

'; + } else { $foto2 = null; } + + $key_name = get_post_custom_values( $key = 'dati' ); + if ( $key_name[0] <> null ) { + $dati1 = '

'.$key_name[0].'

'; + } else { $dati1 = null; } + if ( $key_name[1] <> null ) { + $dati2 = '

'.$key_name[1].'

'; + } else { $dati2 = null; } + + $key_name = get_post_custom_values( $key = 'nome' ); + if ( $key_name[0] <> null ) { + $nome1 = '

'.$key_name[0].'

'; + } else { $nome1 = null; } + if ( $key_name[1] <> null ) { + $nome2 = '

'.$key_name[1].'

'; + } else { $nome2 = null; } + } + + $auth = do_shortcode("[blog-post-coauthors]"); + + $cura = '

Scheda a cura di '.$auth.'

'; + + $menu = do_shortcode("[menucostellazioni]"); + + $out = $cura.$foto1.$nome1.$dati1.$foto2.$nome2.$dati2.$menu; + + return $out; +} );