From 64b47bc82cdda7efff9e5c850c4b229d97a11b51 Mon Sep 17 00:00:00 2001 From: ulaulaman Date: Wed, 11 Nov 2020 02:18:26 +0100 Subject: [PATCH] Inserimento codice di controllo tipologia post --- sidebars/astrodidattica.php | 8 ++++++-- sidebars/astrofoto.php | 8 ++++++-- sidebars/costellazioni.php | 7 +++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/sidebars/astrodidattica.php b/sidebars/astrodidattica.php index dffa4e5..dcd44da 100644 --- a/sidebars/astrodidattica.php +++ b/sidebars/astrodidattica.php @@ -215,8 +215,12 @@ add_shortcode( 'sbdidattica', function () { $licenza = '


Quest\'opera รจ distribuita con Licenza Creative Commons Attribuzione - Non commerciale 4.0 Internazionale.'; $outnew = $outnew.$licenza; - - $out = $img; + + if ( get_post_type() == 'astrodidattica' ) { + $out = $outnew; + } else { + $out = null; + } return $outnew; } ); diff --git a/sidebars/astrofoto.php b/sidebars/astrofoto.php index 7e72034..601a94a 100644 --- a/sidebars/astrofoto.php +++ b/sidebars/astrofoto.php @@ -19,8 +19,12 @@ add_shortcode( 'sbastrofoto', function () { $auth = $auth; } } - - $out = $img.$auth; + + if ( get_post_type() == 'astrofoto' ) { + $out = $out = $img.$auth;; + } else { + $out = null; + } return $out; } ); diff --git a/sidebars/costellazioni.php b/sidebars/costellazioni.php index 9c823c9..25fd47a 100644 --- a/sidebars/costellazioni.php +++ b/sidebars/costellazioni.php @@ -65,10 +65,13 @@ add_shortcode( 'sbcostellazioni', function () { } } - $visibile = '

Visibile in: '.$type.'

'.$season.'

'; - $out = $map.$field1.$field2.$visibile; + if ( get_post_type() == 'costellazioni' ) { + $out = $map.$field1.$field2.$visibile; + } else { + $out = null; + } return $out; } ); \ No newline at end of file