• Hey up,
    I’d like to do something with wordpress that I imagine is possible as this system is so adaptable.

    I use both the blog and static pages. In the blog I need to be able to display links to sub pages whose parent page has the same SLUG as the present blog category SLUG.

    So If I have a blog category with slug “life-2006” and create a static parent page that has the slug “life-2006”, then all its sub page links would appear when viewing that coresponding blog category.

    So I’d need to query the parent category slug and then look in the pages for a matching slug and if this is found – output links to the sub-pages.

    sligowaths wrote this function:

    function get_the_slug() {

    global $post;

    if ( is_single() || is_page() ) {
    return $post->post_name;
    }
    else {
    return “”;
    }

    }

    Not sure if any of it can be used.

    Help :0

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter checksum

    (@checksum)

    In my primitive php head, the logic works along these lines and I’m very aware the syntax is totally off:

    <?php if (is_category()) & category_slug == is_page() post_slug {
    <ul>
    <?php wp_list_pages('title_li=&child_of='. $parent_id); ?>
    </ul>
    }

    if (is_single()) & category_slug == is_page() post_slug {
    <ul>
    <?php wp_list_pages('title_li=&child_of='. $parent_id); ?>
    </ul>
    }
    ?>

    The $parent_id really has no place there – I guess this would require some kind of function.

    Any thoughts?

    Thread Starter checksum

    (@checksum)

    Any plugin authors up for this one?

    I’m looking for this same thing– it could be massively useful if it worked. Anybody?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘if category slug = page slug – do something useful’ is closed to new replies.