Home › Forums › Premium Support › Quick Deploy › Question on syncing local site with live site
This topic contains 1 reply, has 2 voices, and was last updated by Stephen Carroll 1 year, 3 months ago.
-
AuthorPosts
-
February 2, 2012 at 12:23 am #3535
Greetings…
I was wondering if the deploy method will work without reinstalling the wordpress on the live site, just updates.
If I have a local site that I would like to make changes to than apply it to the live site, what would be the best way of syncing it?
Do I just use deploy again? Do I have to use Dreamweaver or can I just use ServerPress to do this?Any of your suggestions and advice would be appreciated as I am trying to create a workflow process around the superb ServerPress,
with all of my new client work. Apologies in advance if I missed this somewhere on the forum.Thank you!
Tristan VFebruary 2, 2012 at 11:07 am #3543Hello Tristan,
DesktopServer is commonly used by theme developers. Keep in mind that there are two parts to a WordPress website. The analogy is close to using a typewriter with custom stationary. The theme, which defines the look and feel is like the stationary one feeds into the typewriter to type on top of. The content, which is what is being typed, comes from the database. Since WordPress is a CMS engine (content management system -or typewriter in our analogy), updates are usually performed to content on the live website itself using the backend administration pages.Although sometimes you may wish to change the look and feel (or ‘stationary’). You can do this by limiting your edits to the wp-content/themes/ folder by altering the style.css file of your activated theme along with some of the PHP files. Usually, you can simply sync or FTP changes to your theme files over to your live server. There are some gotchas however.
Sometimes you may wish to reference your base URL in your theme files. Designers may occasionally type the actual domain URL into the PHP theme files (aka ‘hard coding’). For instance, I might wrap my custom header text with an anchor tag that has a reference to my homepage, i.e.:
<a href=”http://www.example.dev”>Click here for my homepage</a>
While this would work fine on your development box, uploading this to your live server would create problems as the .DEV top level domain is not real, you are more likely to have a real top level domain of .COM or .ORG, etc.
DesktopServer’s export feature will compensate for this by replacing the reference of your site URL with the .DEV to a .COM in both the database and PHP files, but this is only true if you use DesktopServer’s Export feature. It is provided as a convenience feature for creating and deploying one-off websites quickly. But it does have the drawback of requiring the use of the export feature -a sometimes lengthy process.
A good WordPress developer would avoid the problem altogether by not hard coding the URL with the .DEV extension at all. Instead, use WordPress’ template tag for the base URL as a substitute. For instance, the correct way to wrap the aforementioned text would be:
<a href=”<?php bloginfo(‘url’); ?>”>Click here for my homepage</a>
Notice the <?php bloginfo(‘url’); ?> tag? This is a WordPress template tag that specifically references the site url as set by WordPress’ admin menu under Settings -> General -> Site Address (URL)
If you use the template tag in place of hard coding, you can then simply sync your theme files that dictate the look and feel of you site without having to worry about broken links or different references between your live/development server. I hope this helps clarify the issue and concerns with updating your live server.
Regards,
StephenP.S.
For more information about WordPress template tags or the bloginfo tag in particular, reference: -
AuthorPosts
You must be logged in to reply to this topic.

