Tagged: 

Viewing 4 reply threads
  • Author
    Posts
    • #7000
      workvista
      Participant

      I have a custom taxonomy and I use it in a custom post.
      The taxonomy admin UI page always show 0 items. This happens even for the piklist demo taxonomies. See the count = 0 in the attached image.

      When I click it it does show posts grouped in that taxonomy. See the 2nd attachment.

      Attachments:
      You must be logged in to view attached files.
    • #7010
      kattagami
      Member

      I have the same bug on my website but don’t know if Piklist is involved in it.

      I use this SQL query to reset the problem:

      UPDATE wp_term_taxonomy SET count = (
      SELECT COUNT(*) FROM wp_term_relationships rel 
          LEFT JOIN wp_posts po ON (po.ID = rel.object_id) 
          WHERE 
              rel.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id 
              AND 
              wp_term_taxonomy.taxonomy NOT IN ('link_category')
              AND 
              po.post_status IN ('selected', 'publish', 'draft', 'future')
      )

      But each time I save my CPT, if a custom taxonomy is set to it, the count come back to “0”

    • #7011
      workvista
      Participant

      Yes. One more observation:

      The counts work fine as long as I use a custom taxonomy and display it as the default metabox in admin UI.

      When I follow steps on https://piklist.com/learn/doc/display-taxonomies-radio-checkboxes-select-list/
      to convert the input as checkbox – only then the issue with count comes up. So it may have to do with Piklist.


      @kattagami
      – are you displaying taxonomy as select/checkbox/radio too ? That may explain why you see the issue too ?

      • #11287
        bktechcolor
        Participant

        Hey, I just wanna say many thanks to you !. You save my life. get_category() function does work and there is nothing display on my categoires page. but everything work after i follow your code 🙂 love you

      • #11288
        Steve
        Keymaster

        @bktechcolor — glad we could help. Love you too. 😉

    • #7025
      kattagami
      Member

      @workvista Yes, I display my taxonomy in a select menu.

    • #7040
      kattagami
      Member

      Anyone else with this bug ?

      @Steve, are you able to reproduce this bug ?

Viewing 4 reply threads
  • You must be logged in to reply to this topic.