Widget Logic
Need help with Child page and Custom Post Type (2 posts)

  1. ntarantino
    Posted 4 years ago #

    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


  2. ntarantino
    Posted 4 years ago #

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

    global $post; return (get_post_type() == 'sermon' || ($post->post_parent=="63"));

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic