Support » Plugin: Widget Logic » [Plugin: Widget Logic] Need help with Child page and Custom Post Type

  • ntarantino

    (@ntarantino)


    I currently have widget logic working with this:

    global $post; return (in_array(63,get_post_ancestors($post)));

    but I would like it to also show on a custom post type. If I use the following alone, it works:

    get_post_type() == ‘sermon’

    But if I put them together I get an error.

    global $post; return (in_array(63,get_post_ancestors($post))); && get_post_type() == ‘sermon’

    I get this error:

    Parse error: syntax error, unexpected T_BOOLEAN_AND in /var/www/vhosts/onelife.tv/httpdocs/wp-content/plugins/widget-logic/widget_logic.php(270) : eval()’d code on line 1

    http://wordpress.org/extend/plugins/widget-logic/

Viewing 1 replies (of 1 total)
  • ntarantino

    (@ntarantino)

    I have this working, so perhaps I have solved my issue:

    global $post; return (get_post_type() == ‘sermon’ || ($post->post_parent==”63″));

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Widget Logic] Need help with Child page and Custom Post Type’ is closed to new replies.