• Resolved rockwell08

    (@rockwell08)


    Ok, this cache thing is killin’ me! I need to allow users to create categories on their own, within the WordPress interface, not in the admin interface, I’ve done that. I can even attribute a default post to the category, but for the life of me, I cannot get the post category to show in the category list, until the default post I’m attributing to each category has been republished.

    If I open the post for editing in the admin screen, I see the new category listed, and it even has a checkmark next to it, so the system sees it and everything, but its not until I hit the “Save” button, does it show in the category list on the regular website.

    I’ve been reading on the cache system, and it looks like when a post is saved, the cache is somehow cleared, but I’m not sure which function to call to clear the cache. Maybe I can just republish the post? I’m not sure how I can do that either…

    Can someone please help me with this? Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter rockwell08

    (@rockwell08)

    Sorry, by the way, my site is https://www.visitwise.com

    Thread Starter rockwell08

    (@rockwell08)

    Getting there…

    I’m using the latest version of wp-dtree, and in the description of the plugin it states that the plugin employs a cache system, and only updates the navigation when a post is published or saved…

    So my question is this then – how do I clear the cache in the wp-dtree plugin? I tried running the wp_dtree_update_cache() function, to no avail…

    Thanks, again…

    Thread Starter rockwell08

    (@rockwell08)

    I have a feeling this is going to be a conversation with myself, oh well, at least it’ll be documented…

    I have found the following using the example of entering “Montgomery” into the “Alabama” category:

    1. WP enters the location into the database – (insert into wp_terms (name, slug) values(‘Montgomery’, ‘montgomery’)

    2. WP enters the new term into the taxonomy table – (insert into wp_term_taxonomy (term_id, taxonomy, description, parent, count) values (‘486’, ‘category’, ”, ‘184’, ‘1’)

    3. I have created a default post that is assigned to each new entry. I’m only doing this so that I don’t get a 404 error page when a user clicks on a category without any posts. I also have to do this becuase even though I have “show empty categories” turned on, the empty categories are not shown. It looks like a category is considered empty if there are no posts in it, even if there are subcategories in it. At any rate, WP seems to be assigning the post to the category. When I go to the post, either in the admin view or visit the post as a subscriber, I see “Montgomery” listed as one of the categories it is posted to – (insert into wp_term_relationships (object_id, term_taxonomy_id) values (’42’, ‘481’)

    4. After this, I go to a page that updates the WP-dTree Cache. More on this in number 6…

    5. What I’m not seeing happen though, is the newly created category show up under its parent on the Manage -> Categories page. Even though the SQL statement is executed successfully, the category doesn’t actually show up until I associate another post with it. To do this I’m using TDO Mini-forms. Once I associate a post with this category, it shows up as a subcategory of Alabama, as it should.

    6. Another interesting point is that once a category has a sub category, other sub-categories show up as expected. I only have a problem with the first sub-category I enter. So, for example, if I go through the whole thing and insert “Montgomery” as a subcategory of Alabama, using the TDO Mini-Forms method described above, the next time I insert a new category into Alabama, say, Tuscaloosa, Tuscaloosa will show up, right after I refresh the WP-dTree cache.

    So, the problem is that on the first time I attempt to create a sub-category of a category, the newly created sub-category is not recognized as a sub-category until a post is associated with it, even though I have associated a post with it, and have correctly placed it into the taxonomy.

    Am I missing a step in registering the new subcategory with the associated parent category?

    Please? Anybody?

    Thread Starter rockwell08

    (@rockwell08)

    I’ve decided to go ahead and let the form the user fills out just send me an email alert. I’ll do it by hand for now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘This cache thing is killin’ me!’ is closed to new replies.