I'm working on developing my first Wordpress theme. As of now, I've just been coding the files, zipping my theme folder, and then uploading and activating the theme in my Wordpress Dashboard to test it.
However, this has become quite tedious, as I basically have to:
1) code a bit of my theme, zip into folder
2) deactivate/remove old version of theme in Wordpress dashboard
3) upload new version of theme, and activate
4) repeat...
I'd like to install Wordpress locally, but I don't quite understand how to do that yet, and I'm not familiar setting up a local webserver.
SO... rather than do it the tedious way that I have been, is it OK to just make sure my theme is activated, and then edit my files and overwrite/upload them to the wp themes folder over FTP using Filezilla?
I'm guessing it'd be considered bad practice, but for the time being would this work well enough until I learn a better way?
That's definitely okay.
You can modify the files locally and then upload the changes using FTP. Make sure you have backups so if you accidentally FTP the wrong changes you can easily revert them.
Yes you can absolutely download the uncompressed theme and modify and put it back using ftp.
Also, some themes support whats called a child theme. This allows you to override the theme with your changes, without changing the original source code. Which in turn gives you a better upgrade path from the original theme provider when they have updates.
I have actually had some weird formatting issues with WP after manually editing files, where they would no longer run, so I try to avoid it. But I have bad luck that time.
Related
I know we are allowed to used the themes from wordpress and edit them in the theme editor.
However, working in the theme editor is really annoying. Does anybody know if there is a way to download an entire theme file from Wordpress, so that I can customize it in the editor on my laptop?
thanks for the help
You can use Download Plugins and Themes from Dashboard plugin. it's provides a "download link" in theme's detail page.
While #mohammad's answer is correct, I find it best not to clutter a site with unnecessary plugins, what works best is if you login to your server via FTP or your host's cPanel and download the files that way. It keeps your Wordpress install clean of anything that won't be used too frequently.
If you have any questions on how to do this, your host will be able to guide you without issue.
There are multiple solutions to this problem, you can change theme files through the FTP/SFTP account using Filezilla. or you can access your CPanel account go to the File manager and access your file easily. Other then that you can clone your website to your laptop through any migratory tool after that you can configure your website to the localhost and just make changes in Theme according to your requirement from the Xamp/Wamp folder at your system.
I have a Wordpress plugin that I don't want to release to the Wordpress store. Is there any issue in having the version of the plugin in the plugin folder itself?
For example, my plugin is called 'myplugin-1.3.3' and that is the folder that goes into wp-content/plugins.
This seems to be working well because it means that when I upgrade to a new version of this plugin, I can deactivate the old one and if there are any issues, I can re-enable the old one.
I have never seen anyone do anything like this so not sure if it is a bad practice. Previously when updating, I would take a copy of the plugin directory and move it outside of the wp-content/plugins directory so that if I needed to rollback, I could..however this usually means I need cPanel or FTP/SSH access.
I'm having a serious problem. I have wordpress 3.9 installed on my server. the problem is that my website front end loads good, but my back end just loads text :
I have updated/reinstalled wordpress but nothing has happend. What should I do?
Thanks for help.
I'm 100% sure that if you simply do the following, you'll figure out what's wrong and fix it.
Deactivate all plugins without use of your WP-Admin.
Activate them, 2 or 3 at a time, and determine which plugin is the culprit
If none of these plugins are the culprit, go to the WordPress site and download WordPress. With an FTP utility such as FileZilla or another client if you already have one, then upload the entire wp-admin folder to your server, overwriting older files.
Your WordPress admin will be fine after these steps. And of course, never alter any core WordPress files -- ever. The only files you should ever tinker with are files in your child theme, which is something you should be using.
Would be great to have a bit more information about this topic. First of all: Is this a new problem respectively did the admin run without errors before? (3.9 sounds like the page is not a new clean install).
Usually I would start debugging the page via e.g. firebug => Check the Stats of the CSS-Files.
If they load correctly (200) check if they are empty or incomplete (Incompleteness can be checked via diff against the original file ... most IDEs will handle that for you)! If they aren't you have probably just diabled CSS in your browser for the URL of the admin-panel.
If they don't load, try to check why! If the files exist its most probably an error in your .htaccess (wrong rewrite, blocked directory, etc.).
Expertise level: medium-low; I'm not afraid to find a file and edit it, but I don't really understand the inner workings of PHP.
I'm trying to restore a WP blog from backup, but with a fresh 3.7.1 install and a lot more attention to security after a hacking incident. Among other things, I've used Better WP Security to rename the wp-content folder.
My steps were:
Install 3.7.1,
Import the database,
Activate Better WP Security, rename wp-content,
Pull the old theme into the themes folder.
The database restore went fine, and the site is about 90% there, but nothing that linked to the old uploads folder in wp-content is linking now.
I've searched and replaced all of the instances of wp-content on the site using an FTP program and Sublime Text, but I'm still not getting any re-linking. Images are still being sought with generated HTML that looks for things like http://foo.com/wp-content/uploads/2012/12/pants.jpg.
Where else do I need to look for and replace wp-content to the new content folder name? I've tried poking around in the database but I have no idea where to look or what to look for.
I've never used Better WP Security, but if you need to update references to wp-content in the database, the best way to update the database is the Search and Replace for WordPress Databases Script mentioned in the Codex. Don't just try updating the database manually - if the fields contain PHP serialized data (a lot of them do) you'll break things.
Sounds like you already have a database backup, so you should be safe just to give the script a try. The search and replace values will depend on how Better WP Security works, but if the directory is just renamed (to, say, newname), using /wp-content/ and /newname/ should do the trick.
Wordpress saves the attachments URL in the database so you have to replace the image paths in the sql dump (you can use sed ).
You don't have to touch the wordpress core and in the wordpress themes the attachments won't show in the htmls cause were called by wordpress functions.
You can make this
Unzip wordpress in a directory
Make the string replacement (with your new domain) in your old dump sql
import the sql dump
install wordpress with your mysql data and the same db prefix in the backup (it should say that there's already a wordpress installation)
That should work
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.