WordPress.org

Ready to get started?Download WordPress

Forums

is_child() functionality? (10 posts)

  1. lintonbe
    Member
    Posted 9 years ago #

    Does any one know if there is some sort of functionality for checking if a page is a subpage or not. Also if a page is a subpage of a particular page.

    I.E. is_child("portfolio");

    If not I am going to write this functionality.

  2. tbrams
    Member
    Posted 9 years ago #

    I have made a small plugin recently that works for me re this functionality that I hope you can use.

    It's available here:

    http://brams.dk/public/wp/tbr_article_family.zip

  3. lintonbe
    Member
    Posted 9 years ago #

    Thanks, this worked great.

  4. digory
    Member
    Posted 9 years ago #

    Works for me, too. Thanks!

  5. ianalis
    Member
    Posted 9 years ago #

    WFM too but decendant is spelled as descendant :)

  6. strugglefish
    Member
    Posted 8 years ago #

    AWesome! This would be an awesome addition to the core imo, thank you so much, now I wont' have to pull the rest of my hair out.

  7. Gronkh
    Member
    Posted 8 years ago #

    Since I haven't found a plugin yet which has is_child-functionality even for categories, postings as well as for pages, I gave up on searching and wrote one for myself.

    Works with IDs, titles and slugs as search-term.

    http://erik.range-it.de/wordpress/plugins/is_child/

  8. KerimFriedman
    Member
    Posted 7 years ago #

    As I explained here:

    http://wordpress.org/support/topic/79687?replies=1

    I'd like something which displays the current sibling pages and the parent page - but no other top level pages (even "folded").

    This would be very useful for building dynamic menus in static web sites using WP as a backend.

  9. Bedient
    Member
    Posted 7 years ago #

    I think we're trying to do the same thing. Create the feel of seperate blogs in one. I have some butchered code (I know null about PHP) running at the top of this page.

    http://www.villageboating.com/vb/

    Is that what you are thinking? I can post it if someone wants to clean it up.

  10. disembodied
    Member
    Posted 7 years ago #

    I just thought I would bump this because I posted a topic elsewhere about an easy way to get subcategories to highlight its parent category's tab... this is perfect, it gets the category highlighted when it is a page in that category, a page in a subcategory of that category, or the archive of that subcategory.

    Thanks a lot for this plugin!
    (I used Gronkh's by the way, I am not sure how the other one is)

Topic Closed

This topic has been closed to new replies.

About this Topic