WordPress.org

Ready to get started?Download WordPress

Forums

parent-category1/news and parent-category2/news not work (1 post)

  1. newboxters
    Member
    Posted 5 years ago #

    I tried to structure my URL's like this:

    site.com/parent-category1/news - display the news of parent category 1
    site.com/parent-category2/news - display the news of parent category 2
    site.com/parent-category3/news - display the news of parent category 3

    site.com/parent-category1/games - display the games of parent category 1
    site.com/parent-category2/games - display the games of parent category 2
    site.com/parent-category3/games - display the games of parent category 3

    And code view page:
    query_posts(array('category__and' => array('parent-category1','news'))); [...]

    "news" should be a single child category, but currently is not possible, because when children will create a category with Slug "news", rename the wordpress self, even in parent-category is different.

    And so, the preview page, there is no category to identify the parent, since there is no way to get the url as in the example.

    So I thought the solution was to create:

    parent-category1
    - news1 (children category1 news)
    - games1 (children category1 games)

    parent-category2
    - news2 (children category2 news)
    - games2 (children category2 games)

    parent-category3
    - news3 (children category3 news)
    - games3 (children category3 games)

    But well, the url is not the way I hope, will be:
    parent-category1/news1
    parent-category1/games1

    parent-category2/news2
    parent-category2/games2

    Would not have a solution to improve it?

Topic Closed

This topic has been closed to new replies.

About this Topic