Widget logic
-
Salve a tutti, ho installato il plugin in oggetto per escludere un link da tutte le pagine di un blog, tranne che nella home page.
Dal file readme del plugin:
is_home()-- just the main blog page!is_page('about')-- everywhere EXCEPT this specific WP 'page'is_category(array(5,9,10,11))-- category page of one of the given category IDsis_single() && in_category('baked-goods')-- single post that's in the category with this slugcurrent_user_can('level_10')-- admin only widget-
`strpos($_SERVER['HTTP_REFERER'], "google.com")!=false` -- widget to show when clicked through from a google search is_category() && in_array($cat, get_term_children( 5, 'category'))-- category page that's a descendent of category 5global $post; return (in_array(77,get_post_ancestors($post)));-- WP page that is a child of page 77global $post; return (is_page('home') || ($post->post_parent=="13"));-- home page OR the page that's a child of page 13
Qual è il codice da inserire? Dovrebbere essere !is_single() , ma non funziona.
Qualcuno può aiutarmi?
Grazie in anticipo
-
In pratica vuoi caricare un widget solo nella home page?
Se è così, devi utilizzare il seguente codice:
is_home()
-
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi