Support » Plugin: Widget Logic » [Plugin: Widget Logic] parent and all of it's childs and grand kids

  • arizonapain

    (@arizonapain)


    How do I make a widget show up on only it’s self, child and the child of the child. right now I have global’$post; return (in_array(pain-center,get_post_ancestors($post)));’

    that is not working at all

    link is http://arizonapain.com/pain-center/

Viewing 1 replies (of 1 total)
  • Plugin Contributor alanft

    (@alanft)

    do you have some misplaced quote marks there or is that how your code looks?

    anyway, if you look up what get_post_ancestors does http://codex.wordpress.org/Function_Reference/get_post_ancestors you’ll see it returns an array of IDs. so pain-center or ‘pain-center’, the slug is no use to match with in_array. find the ID of the page and use that integer instead. That should do you.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Widget Logic] parent and all of it's childs and grand kids’ is closed to new replies.