Support » Plugin: Widget Logic » Show widget on hierarchical CPT and its subpages

  • I have a hierachical cpt.
    I created something like this:

    • Book 1
      • Unit 1
        • Chapter 1
        • Chapter 2
        • Chapter 3
      • Unit 2
        • Chapter 1
        • Chapter 2
        • Chapter 3
    • Book 2
      • Unit 1
        • Chapter 1
        • Chapter 2
        • Chapter 3
      • Unit 2
        • Chapter 1
        • Chapter 2
        • Chapter 3

    I need to display a different widget for each book and its units and chapters (subpages)
    I tried this:
    is_singular('books') && is_single( 'book-1' )

    This works only con Book 1, but I don’t know how to distinguish units and chapters

    Any idea?

    • This topic was modified 2 years, 2 months ago by Miguel.
    • This topic was modified 2 years, 2 months ago by Miguel.
    • This topic was modified 2 years, 2 months ago by Miguel. Reason: To show the hierarchical issue better
  • The topic ‘Show widget on hierarchical CPT and its subpages’ is closed to new replies.