www.pokeroconnor.com

Quick Guide to New WordPress Install

June6
  1. http://codex.wordpress.org/Installing_WordPress
  2. Logon to your server, and cd document_root_name
  3. wget http://wordpress.org/latest.tar.gz
  4. tar -xzvf latest.tar.gz
  5. cd wordpress
  6. cp -r * ../
  7. cd ..
  8. rm -r wordpress
  9. rm latest.tar.gz
  10. http://codex.wordpress.org/Installing_WordPress#Using_phpMyAdmin
  11. sudo chown www-data document_root_name/
  12. http://example.com/wp-admin/install.php
  13. http://codex.wordpress.org/Changing_The_Site_URL. This is followed if you want to change the WordPress site name from example.com to www.example.com. You may need to add update_option(‘siteurl’,'http://example.com/blog’); and update_option(‘home’,'http://example.com/blog’); to the theme functions.php file. Then reload site, then DELETE these two lines from theme functions.php file.
  14. Change default theme to custom theme, so future updates don’t wipe your changes: cp -r twentyten/ customtheme
  15. Run script as defined on http://www.pokeroconnor.com/recursive-sed-script/ to change all previous theme name mentions

 

//

Add New Header Image to Theme

June6

In WordPress, for example in the TwentyTen theme, you may want to add a new header image to the default options available. This is useful for example if you are copying this theme, to use as the basis for a new theme.

To do so, first upload the image you want to use, and a thumbnail of it to the wp-content/themes/NEW_THEME_NAME/images/headers directory.

Then, in wp-content/themes/NEW_THEME_NAME/functions.php edit the register_default_headers function, to replace ‘sunset’ below with your new image details:

'sunset' => array(
'url' => '%s/images/headers/sunset.jpg',
'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Sunset', 'copied_twenty_theme' )
),

Then go to Appearance -> Theme -> Headers in your Admin panel, and you should be able to select the new image as header.

//
posted under Wordpress | No Comments »

WordPress Visual Editor Missing

May4

This is an annoying issue that happened to me lately, whereby the WordPress visual editor had its buttons and icons missing.

I trawled various forums, and got the usual “do a full re-install” etc, or disable and re-enable all plugins blah blah blah.

The solution is here – its elegant, simple and a one-liner: add the below line to your wp-config.php file.

define(‘CONCATENATE_SCRIPTS’, false );

//
posted under Wordpress | No Comments »

WordPress site redirect

February13

I had the following problem lately: I added the typical rules to htaccess to redirect example.com/anything to www.example.com/anything, e.g.

RewriteEngine On

RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule (.*)$ http://www.example.com/$1 [L,NC,R=301]

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

But when I went to example.com I got infinite redirects…reason being I had the siteurl field in the wp_options table of the database set to http://example.com.

So, you need to change that to http://www.example.com, and also edit wp-config.php as follows:

define('WP_HOME','http://www.example.com');
define('WP_SITEURL','http://www.example.com');

That should be it - see here if not.

//

WordPress Helpers

February10

Here’s some useful WordPress stuff – let’s get the ball rolling:

//
posted under Wordpress | No Comments »