Viewing 3 reply threads
  • Author
    Posts
    • #5296
      George
      Member

      I created a hierarchical post type (with pods) and want to show some fields only if the post has a parent selected:

      Is this possible?

    • #5326
      Steve
      Keymaster

      @fbgm– One of the benefits to Piklist being a code-based framework is that you can wrap your field code in standard PHP conditions. Use the standard WordPress function wp_get_post_parent_id().

      $page_parent = wp_get_post_parent_id($post->ID);
      
      if(!empty($page_parent)) :
      
      your field code here
      
      endif;
      
      

      Does that make sense?

    • #5338
      George
      Member

      Thank you.

    • #5354
      Steve
      Keymaster

      Great! Closing ticket.

Viewing 3 reply threads
  • The topic ‘Showing field if post has parent’ is closed to new replies.