How to update theme from localhost to online site

This depends on your set up. You essentially have two things to move, the Files (images, css, js, php) and the Database.

Moving the theme files is easier, I tend to zip all the theme files on localhost (wp-content > themes > your theme) then install it on the live site under themes > upload which lets you add the zip.

EDIT: You can also use ftp to move the files but it seems to be slower and not as clean.

Now moving the database which controls the pages and menus things get a bit more tricky. It depends on a few things,

  • If you don’t have any data on the live site (or want to start fresh) you can simply move the database but you will lose all other data on the site
  • If you have data on the live site you can use the export then import to move post and pages however this will not move the menus.
  • I typically recreate the pages/menus on the live site then add the theme.

Hope this helps.