I have a plain php script that changes some fields on comment table. Fields like status or text of the comment.
Everything works well as long as I am logged as I admin: the comment are shown with the changes made in the plain php script. As a guest, no change is shown, it looks like there a cache page shown.
Question: is there a way I can invalidate cache problematically as long I make changes on mysql table? Do I have to change some specific fields on that table?
Related
I've inherited a WooCommerce Storefront and need to post a message with the Store Notice feature.
I have updated the text, enable it and publish.
I expect the new text to appear on the banner - in my case on top of the page - but right away the text reverts to an old message. When I go back to the settings page, that old text is in the text area so obviously it overwrote my newly inserted message.
I searched for the string in all the code and it's not hardcoded but I can't find from where it's fetching it.
The only way of making it change is by deleting all the text box and then a 'default' demo text appears in the store notice.
Any clue where is that text stored and why I can't update it with a new message?
A couple of ideas:
1) Are you sure you are not seeing a cache? That seems most likely. Try deactivating all caching plugins (WP Rocket, W3 Total Cache, Swift Performance etc), clearing all cache and viewing the website in Incognito mode / new browser.
2) This may be stored as a setting in the wp_options table. You could check that for the new/old string
3) Are you logged in as Admin? Perhaps you don't have permission to change that string?
I have One Field And Second Field When i Change Data Field one with one name Immedialtly Change Field name Also On Front side Of my site without Refresh.
Describe On Brief
Like Dev tool When We Change Css and effect Immedialty See On Page.
I Need Plugin Like That.
Thank In Advance.
And Sorry For Bad English.
You need to use Ajax calls here.
Make a script that hits in every 3 seconds and under that script make a script code on frontend of the website, which will pick current value from database and show changes according to that on frontend.
I've been running a WordPress site for over a year now and never had a problem with it until yesterday. I'm using a custom field to store the url to a preview image for every post. I simply add it using the standard Custom Fields form in the Edit Post screen. Before when I'd save the post as a draft or if I immediately published it the custom field would be saved. But now all of a sudden no matter how I save the post (save as draft, publish or auto-save) the custom field isn't being stored in the database. I did confirm this by checking the wp_postmeta table.
I already reinstalled Wordpress, but it doesn't change a thing. I also went through other similar posts about this subject, but none of the solutions work.
Any ideas?
So after digging deeper, I figured out the custom field was dependent on another field. Still not sure why it wouldn't store the custom field in the database even though the other field wasn't filled out first. But it works anyway when I do it that way. WordPress works in mysterious ways sometimes.
I have a local build of Drupal 7 with Xampp on windows. When I add a field to a node's content type, I see the field appear last, no matter what order I put the field in Content types > [myType] > Manage fields. I would tend to think this is a cache problem... but I've tried Configuration > Performance > Clear all caches, and the order of the fields does not update.
For example, I currently have an image field, a display title field, and a body field. In the Manage Fields lightbox, the order of the fields is:
Image
Display Title (New field, I'm not using the default title because Drupal always places is above the image instead of after)
Body
However, on the page the order is
Image
Body
Display Title
This is not just a trick caused by funky CSS—the PHP is actually creating the HTML in the wrong order.
I'm guessing that Drupal updates when you add a new field (which appears last by default when created). It does not update when fields are repositioned in Manage Fields, leaving the title last on the page, although it's second in Manage Fields.
And yes, I did save the configuration after repositioning the fields in Manage Fields. I've also cleared the browser cache, and restarted the browser.
How can I get Drupal to display the fields in the order they appear in Manage Fields?
P.S. I also downloaded Drush to see if it could clear the cache. The Drush command line works, but none of the tutorials I found actually explain how to hook Drush up to a local install, only how to SSH into remote server... I typed in 'drush cc' my drupal folder, but I don't know if Drush actually did anything since I don't know how to make drush connect to my localhost.
Not a complete answer, but 'Manage Display' does not, in fact, Manage the Display. It manages the order of the fields when editing a content type, but does not influence the order in which they are displayed.
So, I was looking at it again (figuring I would have to edit into printing individual fields in the content)... and I was looking at the Devel tab (Developer module), and clicked 'render.' Some how that fixed / updated the page, and the title jumped from the bottom to above the body text.
Still not sure exactly what controls the order that fields display in... Maybe I'm a complete n00b, but if the info's out there, it's hard to find.
I want my users to be able to mark posts as favorite. I tried the wp-favorite-posts plugin, but it doesn't work. I mark posts as favorites and after refreshing the page it's all gone. Furthermore, if I put {{wp-favorite-posts}} to a page, it just shows the text.
So I want to create my own solution, but don't really know how. I have never edited the WP database, but I have plenty of PHP mySQL experience.
Can anyone please point me in the right direction ?
You can use post_meta. You can store the "favourite" aspect as a custom field attached to each post. You don't need to manually edit the database (i.e. via mySQL).
When you want to show the favourited posts, run a custom query that only shows posts with the specific custom field that you've specified.