- This topic has 18 replies, 2 voices, and was last updated 5 years, 5 months ago by
Sebastian.
Author | Posts |
---|---|
olleka
November 13, 2019 at 5:02 pm
|
Heads up! this post was created when Microthemer was at version 5. The current version is 7. Some references to the interface may be out of date. Hi. Sorry to bring this up again. But we can not get it to work. Somehow it seems that the active.styles.css can be overwritten with the cached old copy. h2 a { 1. I verified that the file was pushed to GitHub. Check! So it seems to me a bug somewhere either the cache or MT. Can MT active-styles.css be owerwritten just by open it and close it without doing any changes? Regards |
Sebastian
November 14, 2019 at 12:06 pm
|
Hey Olle, MT displays settings stored in the database. It doesn’t read from active-styles.css as some of the UI data isn’t in the form of pure CSS. Also, when you use the Show generated CSS feature within Microthemer, it re-saves the settings to ensure the stylesheet reflects the latest MT changes (not useful in your special case of course). Because you did this action on the live site, it updated the stylesheet using the out of date style settings in the live database. So with your system, you probably needed to wait longer than 20 mins for the cache to clear, as well as keep out of the MT interface on the live site. Or sync the database values, but that can be fiddly with the wp_options table, as I mentioned in our previous thread. Cheers, |
olleka
November 14, 2019 at 12:56 pm
|
I thought you said before that it would be enough to move just the active-styles.css to the live site. So with my git setup dev->live how would I move safely the new CSS from dev to live? If I sync the wp_options and just sync In my other sites I have moved the whole site. Therefore I have never had this problem. Regards |
Sebastian
November 14, 2019 at 2:48 pm
|
Hey Olle, I was saying you can just Git sync the stylesheet if you want to keep your Git setup simple. But that means you can’t use MT on the live site. If that is a downside for you, then I recommend also syncing the database as a solution. So yes, syncing those two options will do the trick: preferences_themer_loader And if you’re taking the time to sync databases, you should also sync the wp_micro_revisions table, so the history is synced too. Cheers, |
olleka
November 14, 2019 at 3:13 pm
|
Ok thanks for the clarification. Since I can’t use MT in the live site. What do you think about deactivating MT in the live site and have MTs CSS code load from the functions.php “inactive” settings? With that I don’t need the database right? Regards |
Sebastian
November 14, 2019 at 5:43 pm
|
Yes absolutely. That will save you from accidentally using MT on the live site 🙂 |
olleka
November 15, 2019 at 1:34 pm
|
So I deactivated MT. But it still shows the wrong CSS file. Do I need to remove MT compleatly? And remove the MT fields from the wp_options table also? Regards |
olleka
November 15, 2019 at 3:34 pm
|
So that is because the database tables are still there in the live site right? Gah. This turned out to be a nightmare. MT is not really designed for this kind of scenario. Consider this. If I remove the fields in the database (by deleting MT and the settings) Probably It will serve the right CSS file. Just guessing. But If I then synk the live-> dev database befor the next development cycle. What will be shown in the dev site? Because the MT settings is not in the database thet I pull from live site. Sort of impossible to get this right. I surprised you have not any fix for this scenario. Or am I the first person working like this? How does other people using MT in a dev-live stup normally do? Regards |
Sebastian
November 15, 2019 at 4:13 pm
|
Hey Olle, You don’t need to delete any database content. Just deactivate Microthemer (or optionally uninstall). Did you remember to push the local version of active styles again and wait the the cache to clear? If you pull the database from the live site in future that will overwrite your (most up to date) local MT settings though. So really, I think your only option is to sync the local DB settings for MT with the live site. That way everything is equivalent. And you can pull data from the live DB in future without losing anything. Cheers, P.S. The normal way to work locally is to export your local settings to a zip file which you install on the live site. You are indeed the first person to ask about GIT integration methods. |
olleka
November 15, 2019 at 4:30 pm
|
Well yes. If you go to You can se the CSS i pushed to live. So its the right file. However If I go to the page and inspect the element it shows the wrong CSS and that CSS is still rendered from the link I did empty the cache several times. If I read the php code in functions php mts=1 when MT is off? and if I go to Very strange. Regards |
olleka
November 15, 2019 at 4:37 pm
|
Sorry mts=0 I can by anything but 8916. I cannot see why that is still there. If I remove MT will it also remove the database fields? If I then reinstall MT will the “inactive” setting pick up the “old” CSS file and start the count from 0 Thanks |
Sebastian
November 15, 2019 at 4:51 pm
|
Hey Olle, If you install MT it won’t delete the DB fields unless you choose the “Upon Uninstall, Delete ALL Microthemer Data” option on the MT Preferences > Inactive tab. That will also delete everything in the /wp-content/micro-themes/ folder, including the active-styles.css stylesheet. So you would need push the file again. Your make an interesting point I hadn’t considered re the mts=1 piece of “inactive” code you pasted to your theme’s functions.php file. You can manually change that number to anything you want. So, set a unique number just before pushing code to git, and then the stylesheet will have a unique URL on the live site, which will refresh your server’s cache of that file. Cheers, |
olleka
November 15, 2019 at 4:55 pm
|
Aha so you mean I can put something like Regards |
Sebastian
November 15, 2019 at 4:57 pm
|
Or rather simply:
Because $p[‘num_saves’] pulls from the database, which you don’t want. Cheers, |
olleka
November 15, 2019 at 4:59 pm
|
Ok 🙂 Regards |
olleka
November 15, 2019 at 5:32 pm
|
Hm i got a ” Failed to load resource: the server responded with a status of 404 () active-styles.css1234:1″ |
olleka
November 15, 2019 at 5:52 pm
|
Ok, got it. The code should probably be Regards |
olleka
November 16, 2019 at 7:10 am
|
It works! I’m a happy man now 🙂 Regards |
Sebastian
November 16, 2019 at 5:56 pm
|
Ah wonderful, I’m really glad we got there in the end 🙂 Sorry about the incorrect $mts example. |