WordPress.org

Ready to get started?Download WordPress

Forums

how to extend conditional function to sub-sub-pages? (3 posts)

  1. nair
    Member
    Posted 6 years ago #

    Hi everyone!

    i want to extend a conditional function tag to sub-sub-pages but i don't know how (i did before a lot of search but didn't find nothing). at the moment i have this code that works only at sub-pages:

    `if ( (in_category('29'))||(is_page('2007-premiados')||$post->post_parent=="14") ) {
    echo '<div id="submenu">
    <ul class="fix">';

    wp_list_cats('optioncount=0&child_of=29&orderby=ID');

    echo '
    </div>';'

    how to increase to sub-sub-pages of post_parent=="14"?

    thanks!

  2. sbarry50
    Member
    Posted 6 years ago #

    I dont't know if this is the easiest and/or best way to do it but it worked for me.

    if(is_page('3') || $post->post_parent=="3" || $post->post_parent=="33" || $post->post_parent=="34" || $post->post_parent=="35")

    In this case ID's 33, 34, & 35 were subpages of 3. 33,34,&35 all had subpages of their own. It applied the execution to all of them and their subpages.

  3. nair
    Member
    Posted 6 years ago #

    hi sbarry50,

    yes... for a few subpages that code it works, but when i have more than fifty subpages i need a better solution...

    thanks for the reply!

Topic Closed

This topic has been closed to new replies.

About this Topic