Forums › Forums › Search & Filter Pro › Autocount field not updated
Tagged: autocount cache refresh
- This topic has 19 replies, 3 voices, and was last updated 9 years, 1 month ago by
Ross.
-
Anonymous(Private) February 17, 2017 at 4:08 pm #90924
Hello,
I have to add posts programmaticaly.
I includ all the necessary functions to add wordpress functions in my file.
After adding or updating or deleting a post i call thedo_action(‘search_filter_update_post_cache’, $post_id);hook.It seems that the post is correctly added to the default list but not in the filtered meta fields.
For exemple the autocount field is not updated and when I filter on a peculiar custom category the post is not visible.Do you give me a trick to do this stuff ?
Thanks a lot.
Trevor(Private) February 17, 2017 at 4:56 pm #90939Hi
If you have a category field, you can turn the count on for each. Examine a post that has been newly created this way, knowing the category it has, note the count in brackets after the term in the field select box. Now go the WP Admin, hover over the Post Type and select the category taxonomy menu option. This will list all the categories for that post type.
Find that same category term and at the end of the line is the count again. Now, click that count number and the admin will open a page with that post type filtered by that category. At the top on the right is the post count.
Do all three counts match?
Trevor(Private) February 24, 2017 at 9:19 am #92682One thing I did notice, in your first posts, is that the quote marks in the code snippet you posted are wrong. You show curly (so-called smart) quotes, and they should be straight.
Whilst you did not say this explicitly before, are you using a bulk import tool? And dd you run that code snippet after each post is imported, not after the batch?
-
AuthorPosts