Taxonomy page fails when department title is different from the slug

  • Posted in : Responsy WP
  • egonsch
    Participant

    I don’t know if this is a wordpress issue of it is related to the template. Anyway, I’ve found that if your department name is different from the slug it won’t work at all.

    In my case, I have a department called ‘Windows Phone’ and the slug is ‘windowsphone’. Whenever I use the taxonomy.php template for showing this specific department it won’t show nothing.

    As far as I can see, the problem is in line 71:
    $args_department = array( ‘post_type’ => ‘portfolio’, ‘department’ => single_cat_title( “”, false ), ‘posts_per_page’ => -1 );

    single_cat_title will use the title instead of the slug so here is the problem if they both are different.

    My solution is to change this line for this one:
    $args_department = array( ‘post_type’ => ‘portfolio’, ‘department’ => $cat, ‘posts_per_page’ => -1 );

    I will really appreciate if you fix this issue on next releases.

    Thank you very much!


    Roberto.

    Mehmet S.
    Keymaster

    Ok, thanks for the feedback.

    egonsch
    Participant

    Sorry, I didn’t correctly copy the solution line. Here it is:

    $args_department = array( ‘post_type’ => ‘portfolio’, ‘department’ => get_query_var( ‘term’ ), ‘posts_per_page’ => -1 );

    Best regards,

    Roberto.

    Mehmet S.
    Keymaster

    Thank you, that worked.

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Responsy WP’ is closed to new topics and replies.