WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] Custom Taxonomies Show No Posts (7 posts)

  1. Dominic
    Member
    Posted 2 years ago #

    Hello, my site uses a universal custom taxonomy to tag content of all post types (post, page, custom-type, etc.). The rewrite rule for my custom taxonomy is as follows:

    'rewrite' => array(
      'slug' => 'tag',
      'with_front' => false,
      'hierarchical' => false
    )

    With 3.2.1, I was able to see a list of all posts tagged with a given term by visiting /tag/[term-slug]. On 3.3, I don't get a 404, but no posts are ever returned.

    Any idea if the API changed and I'm registering my taxonomy wrong now, or if this is a bug?

  2. Dominic
    Member
    Posted 2 years ago #

    Ok, after a little more digging, it seems like the problem is that the main query for returning posts is never fired.

    I used define( 'SAVEQUERIES', true ); to show all of the queries there were executed for each page. On a regular archive page that is working correctly, I see a query that looks like this:

    SELECT SQL_CALC_FOUND_ROWS  wp_posts.*
    FROM wp_posts
    WHERE 1=1
    AND wp_posts.post_type = 'post'
    AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')
    ORDER BY wp_posts.post_date DESC LIMIT 0, 10

    Followed by SELECT FOUND_ROWS(). However, on my taxonomy page (the one that comes up blank), there is no query that is selecting from wp_posts. I still see the SELECT FOUND_ROWS() query, but the query immediately preceding isn't getting any posts. It looks like this:

    SELECT wp_term_taxonomy.term_taxonomy_id
    FROM wp_term_taxonomy
    INNER JOIN wp_terms USING (term_id)
    WHERE taxonomy = 'my-custom-taxonomy'
    AND wp_terms.slug IN ('taxonomy-term')

    This is really baffling to me, and if anybody has any idea what could be the cause of this, I would really appreciate it. Thanks.

  3. Dominic
    Member
    Posted 2 years ago #

    I just updated to Beta 3 and this is still broken. I feel like I must be doing something wrong, but the fact that I works perfectly in 3.2.1 makes me think this is a WordPress bug.

    Is anybody else experiencing issues with custom taxonomies?

  4. Dominic
    Member
    Posted 2 years ago #

    Ok, I feel like an idiot. I just deactivated one of my plugins, and now the taxonomy pages are working perfectly again. Must be a bug with that plugin then. Sorry for taking anyone's time.

  5. atreidex
    Member
    Posted 1 year ago #

    Dominic, what was the plugin causing the issue? That is if you can still remember after 8 months.

  6. Dominic
    Member
    Posted 1 year ago #

    @atreidex, I'm pretty sure it was Shopp. It was around then that I switched from Shopp to WooCommerce (which I love).

  7. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    3.3 is well out of beta now.

Topic Closed

This topic has been closed to new replies.

About this Topic