• All I can find is either or both not for a specific subpage, or includes the parent page, lists subpages (not showing other content) or just plain isn’t working for me.

    The conditional tags page has nothing for me.

    I want to show certain social links only on all subpages of a specific page.

    (I also want to show other social things on pages like posts, just btw.)

    So I want a conditional type thing of is subpage of page 3, type of thing. Obviously that wasn’t the PHP.

    Right now I’m sure I can do this with several more templates instead of one index. I’m building my own theme from scratch, so started with the “simpler” thing of fewer template files, but more is fine.

    It will do great in case there is no answer.

    ?? Thanks.

Viewing 1 replies (of 1 total)
  • I believe you can check in this way:

    if ( $post->post_parent == 3 ) { // replace with needed paretn ID
      // show social links
    } else {
      // do not show them
    }

    Sorry.. am i understood your question properly?-)

Viewing 1 replies (of 1 total)
  • The topic ‘Custom content if page is subpage of specific page’ is closed to new replies.