Widget Logic: exemples de paramètres du plugin WordPress

A lire sur wordpress.org (et à garder sous le coude).

Voici :

Examples:

    * 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 IDs
    * is_single() && in_category(‘baked-goods’) — single post that’s in the category with this slug
    * current_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 5
    * global $post; return (in_array(77,get_post_ancestors($post))); — WP page that is a child of page 77
    * global $post; return (is_page(‘home’) || ($post->post_parent==”13″)); — home page OR the page that’s a child of page 13

Yiannis Girod

Yiannis Girod est administrateur de la société éponyme. Il est également formateur en informatique et créateur de sites web sous CMS (spécialiste Wordpress).