I want to add the auto-update feature to theme or plugins that I publish separately from the WordPress repository. Thanks if anyone can help.
I searched Google several times but did not find any results.
I think we need to write a script and put the updates in it and get the plugin updates from it.
I've built a wordpress child theme for a client and currently deploy each version as a manual .zip theme upload by having to rename each .zip file to a unique identifier (i.e. newtheme-2017-06-07.zip) and then deleting the previous version manually.
Is there a way to upload child themes via wordpress admin so that it overwrites any theme with the same name? I don't want to be going down the route of using FTP to manually overwrite the theme.
I'd also be keen to hear how the update API works so that a customer gets alerted in the admin section that an update is available. So far my searches have been particularly unsuccessful.
Any advice or pointers would be much appreciated!
I'm currently host my site with managed WP hosting (I have no access to my file directory). I use child theme that contains only style.css file (aimed to store the customization only) and I do not activate WP editor for security reason.
When I want to update my parent theme I should delete the old version first and my site automatically changes to other existing theme which is completely different.
To upload my new version theme it takes time about 1 minute and that means users will see my site with different theme while the uploading process.
My question:
How to update my theme without delete it first or is there a plugin I can use?
If there is no such a way, how to show error message ("Hey we'r currently customizing our site ...") during the uploading process?
Thanks.
if you are using the child theme then you can directly update as it does not effect your changes for child theme
and for showing maintenance there are many plugins that provides the maintenance mode functionality.one of theme is
https://wordpress.org/plugins/wp-maintenance-mode/
its show a template while you are in maintenance mode once done change deactivate the maintenance mode
What's the best way to work on a WP theme on a live site? So that the users see the current theme and I can see the one I'm working on. I know WP has a preview theme option, which works, but it has a sidebar that lets you go back to the WP management page, which means when I try to inspect the source it has lots of extra stuff that the actual theme wouldn't have.
Any ideas? Thanks.
Working on a live site is not a good idea. All changes you make will be viewable to your users.
You have two options here. The first option is to create a subdomain like test.example.com and install wordpress there. From there you can do changes to the theme without worrying about the live site. Once done, you can just move your theme over to the live site.
The second and best option is to install wordpress locally on your pc. I use xammplite for that purpose. It works the same as a live install, but it is faster making changes to a theme. Also, if you make a mistake somewhere like a syntax error, you can correct it quickly, no need to ftp a file backwards and forwards between pc and live site.
If this doesn't cut it, your last least favored option is to download a maintanance plugin and put your site in maintainance mode. You will be able to see and test your site, and everyone else will see a maintainance notice
I'm in the process of learning php and creating themes.
Unfortunately, while I was editing a theme that i was currently using in drupal, I made a mistake in the theme such that nothing shows up anymore, even if i were to hit drupal/index.php. I want to change my broken drupal theme to a working one but i'm unable to do so because I can't even view the administration section.
The How To reset your theme via the database page on Drupal.org has instructions for changing your theme directly from the SQL prompt.
It's not immediately clear whether this will work in the most recent version of Drupal, so back up your database before attempting this.
The easiest way to change your frontend theme is to set it in your sites/default/settings.php:
$conf['theme_default'] = 'minelli';
In terms of sorting your current problem, here's a simple way to do it that should work... Let's say your current theme is called "custom_theme".
Go to your theme directory ("sites/default/themes" probably)
Backup your development theme (i.e. move it elsewhere, if you're using Linux command line do something like "mv custom_theme custom_theme.bak")
Copy the garland theme to here and name it the same as your broken theme (if using LInux command line, something like this should work "cp -a ../../../themes/garland ./custom_theme"
Try viewing your site now. It should now use garland instead of your broken theme.
As others have said before, it's also highly recommended that you use a different theme for admins as you do for normal users (in case you break stuff). Select a safe admin theme (like garland) and then you can nearly always get to the admin interface if you're playing with theming.
Or if you are using Drupal 6, removing/moving the broken theme folder will make Drupal change the theme to the default theme (Garland).
Maybe using two themes in parallel will help.
Set one for the "user frontend" - the one you are developing at /admin/build/themes, another one standard, like garland, which you are NOT going to change, as a "administration backend": /admin/settings/admin.
If you happen to break the theme you're developing, you just go to the admin area (/admin), it will switch back to garland.
you can also insert a new login form in your theme by including this code:
`<?php
if(!user_is_logged_in() ){
print drupal_render(drupal_get_form('user_login'));
}else{
print "You are already logged in!";
}?>`
anywhere in the page.tpl.php file of your broken theme, then register with your admin credentials ;)
Please also see the following stack over flow issue.
it is related to them
Changing Drupal's theme and keeping Garland as the admin theme?
Changing the Admin Theme in Drupal 6 Directly in Database
Now here is solution :
Remove the files of the bad theme and clear the cache. After clearing the cache you will be able to login again.
The main difficulty is that you have to clear the cache without being logged in.
Try one of the methods for clearing the cache described in
Clearing Drupal's cache
IF Not then Try this one :
If you have drush, the command to type would be
drush vset theme_default garland
Either on the commandline, or via an administration interface (eg PHPMyAdmin) enter the following query
UPDATE system SET status=1 WHERE name = 'garland';
Then either:
UPDATE variable SET value='s:7:"garland"' WHERE name = 'theme_default';
TRUNCATE cache;
TRUNCATE cache_bootstrap;
TRUNCATE cache_block;
Note that 's:7' refers to the length of the following string. Modify as needed. This is database surgery, tricky stuff.
OR
If you are using per-user themes, and you've just messed it up for yourself as admin, try
UPDATE users SET theme='garland' WHERE uid = '1';
Be careful, as getting either of those lines wrong can mess things up just as badly.
Cheers!
Mudassar Ali
As far as I know, theme settings are stored in the database, as well for each individual user. The quickest way to get rid of a theme is probably removing it from the theme path.
Just move it onto your desktop and Drupal should be able to detect that your requested theme is missing and point you to the default instead.
Update: Tried this on my Drupal 5 installation, it turned out 'clean'. I suggest copying a working Drupal theme into your theme directory (make a copy first).
It's worth mentioning that if you're using the "Sections" module to apply different themes to different parts of the site, the instructions given on the Drupal site won't necessarily work — you may find that moving the problem theme directory out of the way is the only method of seeing the admin interface properly.