Support » Plugin: Custom Content Shortcode » If page has a parent

  • Hi,

    I’m trying to check if a page has a parent page.

    Currently, i’m able to check the parent slug of a page having a parent, like this:

    [if parent=my-parent-page]
        PARENT SLUG MATCHES!
    [else]
        PARENT SLUG DOESN'T MATCH!
    [/if]

    But when trying to check if the page has a parent or not, like this:

    [if parent=]
        HAS NO PARENT!
    [else]
        HAS PARENT!
    [/if]

    …the conditional always returns PARENT!, even if the page doesn’t have a parent.

    Any hint please?

    • This topic was modified 1 year, 6 months ago by studioavanti.
    • This topic was modified 1 year, 6 months ago by studioavanti.
  • The topic ‘If page has a parent’ is closed to new replies.