Custom taxonomy archive page

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Custom taxonomy archive page

Lox-2
Hello,

I have registred a custom taxonomy for a custom post_type. The taxonomy UI
shows properly for that custom post_type in wp-admin and I can assign posts
to it.

When I try to access a taxonomy's archive page (using the display link in
the taxonomy UI in wp-admin), it is always a 404 page.

I looked a bit and here is the query generated:

SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN
wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (13) ) AND
wp_posts.post_type IN ('post', 'page', 'attachment') AND
(wp_posts.post_status = 'publish' OR wp_posts.post_author = 1 AND
wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY
wp_posts.post_date DESC LIMIT 0, 10

So the part giving me trouble seems to be:

AND wp_posts.post_type IN ('post', 'page', 'attachment')

Why does WP restrict to those post_type whereas my taxonomy is allocated
only to my custom post type?

Should I hack the query using filters?

Regards.

--
Lox
[hidden email]
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Custom taxonomy archive page

Simon Vart
Hello,

You shouldn't have to. Did you flush the rewrite rules by validating the
permalink setup page ?

--
---------------------
Simon Vart
studio de communication exigences
10 Rue Amiral Ronarch
29660 Carantec
----
02.98.67.92.70
06.09.97.82.91
www.exigences.biz
linkedin : http://www.linkedin.com/profile/view?id=87258047
twitter : @simonvart
skype: carantecinfo
---------------------

Le 30/04/2013 10:08, Lox a écrit :

> Hello,
>
> I have registred a custom taxonomy for a custom post_type. The taxonomy UI
> shows properly for that custom post_type in wp-admin and I can assign posts
> to it.
>
> When I try to access a taxonomy's archive page (using the display link in
> the taxonomy UI in wp-admin), it is always a 404 page.
>
> I looked a bit and here is the query generated:
>
> SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN
> wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
> WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (13) ) AND
> wp_posts.post_type IN ('post', 'page', 'attachment') AND
> (wp_posts.post_status = 'publish' OR wp_posts.post_author = 1 AND
> wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY
> wp_posts.post_date DESC LIMIT 0, 10
>
> So the part giving me trouble seems to be:
>
> AND wp_posts.post_type IN ('post', 'page', 'attachment')
>
> Why does WP restrict to those post_type whereas my taxonomy is allocated
> only to my custom post type?
>
> Should I hack the query using filters?
>
> Regards.
>

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Custom taxonomy archive page

Lox-2
2013/4/30 Simon Vart <[hidden email]>

> You shouldn't have to. Did you flush the rewrite rules by validating the
> permalink setup page ?


Yes I did.

As you can see the term is correctly detected in the URL:
wp_term_relationships.term_taxonomy_id IN (13)

Also I forgot to say that I also tried to deactivate all plugins.

--
Lox
[hidden email]
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Custom taxonomy archive page

Lox-2
Hello,

I have found the issue: the post_type has to be set to public.

2013/5/1 Lox <[hidden email]>

> 2013/4/30 Simon Vart <[hidden email]>
>
>> You shouldn't have to. Did you flush the rewrite rules by validating the
>> permalink setup page ?
>
>
> Yes I did.
>
> As you can see the term is correctly detected in the URL:
> wp_term_relationships.term_taxonomy_id IN (13)
>
> Also I forgot to say that I also tried to deactivate all plugins.
>


--
Lox
[hidden email]
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers