WordPress.org

Support

Support » How-To and Troubleshooting » Multiple categories issues

Multiple categories issues

  • Hi ,

    I am working on the portfolio site for my client. He came up with very difficult design to implement into the WordPress.

    Anyway, They have a two main categories for their portfolio site: By Services and By Markets. So, ones you click the By Services you should see the subcategories then you click the sub and you should see the titles of the projects for this category.

    Problem appears when client assign a project to both By Services and By Markets categories. When you want to see the projects under the By Markets, you’are switched to the By Services results.

    Here is the URL: http://lhaworld.bolderimage.com/work/by-services/

    Please advice. I tell client they can only assign a project to specific category only, but they really want to have a one entry assigned to both categories.

    Thanks,Krystian

Viewing 7 replies - 1 through 7 (of 7 total)
  • apologies for duplicating my posts. I very desperate to find a solution to this issue.

    I don’t see the by-markets category and will assume you do have posts with those categories–deactivate all plugins, switch to the WordPress Default theme. Can you navigate properly. If not try deleting your .htaccess file and updating your permalinks.

    thanks, I’ll try that

    I can see the problem by following these steps:

    1. Click on ‘By Markets’ under ‘Work’.
    2. A list of market areas is shown, including ‘Technology’.
    3. Click on ‘Technology’.
    4. Now the list changes to the ‘By Services’ list.

    I am guessing that you generate the list by looking at the category of a post and that when a post is in two categories, the first one found is used when you got to the post via the second one.

    In a similar situation, I had to pass an additional parameter on the URL to give the category to follow. Then retrieve it with $_GET.

    vtxyzzy, sounds like plan. Would you have any examples I could follow?

    Thanks

    After looking at your site further, I am not sure that the approach I mentioned earlier will work without a lot of changes. For my situation, I only had to deal with a small number of posts. Anyway, what I did was to modify each link by adding, for example, ?incategory=14 to stay in category 14. My links then looked like:

    http://mysite.com/blog/events/?incategory=14

    Then, to get the category in the template, I had code like this:

    $cat = (isset($_GET['incategory'])) ? $_GET['incategory'] ? $default_cat;
    $args = array('cat' => $cat);
    query_posts($args);

    For your site there may be too many places to change the links to make this practical, but I can’t think of a better solution.

    thanks a lot for your help. I will test it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Multiple categories issues’ is closed to new replies.
Skip to toolbar