How to change a WordPress site URL

Sometimes you may need to change the URL of your WordPress site.

For example, it is a common practice to develop the new version of your site in a subfolder and when it is ready to move it into your root directory.

WordPress, however, relies on its URL settings to work correctly.

This means that if you simply move your files and database it will not work properly.

The URL settings are located in the application database. Fortunately, direct database modification can be avoided by using a nice function provided by the WordPress developers named “update_option”.

Simply add these lines to the functions.php file of your theme:

update_option('siteurl','http://www.new-site-address.com');
update_option('home','http://www.new-site-address.com');

wordpress-change-url

Then simply load your site from its new location – it should work just fine.

Note that after you run your site once and you make sure it works you should delete those lines from your functions.php file. The settings are already stored in your database and should not be modified each time your site is loaded.

Source (sorry ordinary copy/past): http://www.siteground.com/tutorials/wordpress/change-url.htm

Write code in your wordpress page

[banner]

Sometimes you want to put code in your wordpress blog. The beste way to write code is switch to switch to HTML and put the <code> and </code> tags to your post.

Example with <code>:


mailq | tail -n +2 | grep -v '^ *(' | awk  'BEGIN { RS = "" } { if ($7 == "user@example.com") print $1 } ' | tr -d '*!' | postsuper -d -

Example withoute <code>:

mailq | tail -n +2 | grep -v ‘^ *(‘ | awk  ‘BEGIN { RS = “” } { if ($7 == “user@example.com”) print $1 } ‘ | tr -d ‘*!’ | postsuper -d –

You will see that some characters won’t display correctly if you don’t use the code tag.

Another/better way to publish code is using the “SyntaxHighlighter Evolved” plugin.

Example:

mailq | tail -n +2 | grep -v '^ *(' | awk  'BEGIN { RS = "" } { if ($7 == "user@example.com") print $1 } ' | tr -d '*!' | postsuper -d -

And if you need special characters in your post try these:

< = &lt;
> = &gt;
/ = &#47;  	
] = &#93;
[ = &#91;
" = &#34;
' = &#39;

And if you want to use a code language try these

[code language="sql"]
your code here
[/code]

The following languages are supported:

actionscript3
bash
clojure
coldfusion
cpp
csharp
css
delphi
erlang
fsharp
diff
groovy
html
javascript
java
javafx
matlab (keywords only)
objc
perl
php
text
powershell
python
r
ruby
scala
sql
vb
xml

SQL script Example:

USE database;
SELECT * FROM Persons
WHERE City='Sandnes'

Last but not least. DO NOT USE THE VISUAL VIEW 🙂 Visual will scramble your code.

[banner]

Create new themes with Artisteer

Today is was time for a new WordPress skin/theme. I search the default wordpress themes but without success. Then I tried Artisteer. I used it for a Joomla theme once and it is very easy to create nice looking theme for WordPress, Joomla and Drupal.

If you can work with Office 2007 and above you can create themes 🙂

Check screen: