Forums

problem with taxonomy slugs! (3 posts)

  1. Hamzar
    Member
    Posted 1 year ago #

    hey ,
    i tried to to use the plus sign instead of dashes in taxonomy slugs and all goes fine except when i request the page :
    http://site.com/tag/okay+good
    i can't find the tag ! (i checked the database and there is really a tag with "okay+good" slug !
    i used the debbug plugin to analyze the query and the problem is from it !

    Query: SELECT p.ID FROM wp_posts p INNER JOIN wp_term_relationships tr ON (p.ID = tr.object_id) INNER JOIN wp_term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) INNER JOIN wp_terms t ON (tt.term_id = t.term_id) WHERE tt.taxonomy = 'post_tag' AND t.slug IN ('okay', 'good') GROUP BY p.ID HAVING count(p.ID) = 2
    Call from: require, wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts

    like we can see there is a function wich divides the slug into two parts !
    so can anyone help me fixing the problem?

  2. Xephan
    Member
    Posted 1 year ago #

    Don't use plus signs, they have specific meanings in an URL which is why your slug get parsed into two words; + means a space in the query part of an URL.

  3. Hamzar
    Member
    Posted 1 year ago #

    i used the plus sign in th postname and all goes okay .
    just i have to find the function that manage the url.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.