Wordpress

Toggle view

Upgraded to WordPress 2.8.4

Upgraded to WordPress 2.8.4

Google Analytics

Just activated Google Analytics to my blog. I added the Google code to my “templates/end.php”.

WordPress Image Thumbnail not working

When adding an image from my media library, the image dialog shows the options Thumbnail, Medium, Large, Full Size (pre-selected) but I’m not able to change this option. A bug with WordPress???

No, seems with the upgrade to WordPress 2.7.x the PHPx-GD library is requried to support this feature. I installed it with:

apt-get install php4-gd
/etc/init.d/apache2 restart

Upgraded to WordPress 2.7.1

This has been pending now for a while. But I’m glad that I did it now since the new administration interface really is much better now!

Using a new wordpress theme

Recently I came across a corporate wordpress based web site. They had customized the iNove theme. So I had a look at the original one and found it much better for my own blog. It offers a bit more space for content and is organized better as I feel it. So as of now I’m using this theme from http://wordpress.org/extend/themes/inove .

Created a WordPress plugin for SyntaxHighlighter

Finally I had a chance to convert the http://alexgorbatchev.com/wiki/SyntaxHighlighter into a WordPress plugin. So in future I can change themes freely and still continue to use syntax highlighting.
Here is what was needed to be done:

  1. Downloaded SyntaxHighlighter 2.0
  2. Extracted files and placed in a plugin folder syntax-highlight. The folder scripts/*.* was extracted into /scripts folder and styles/*.* into /styles.
  3. Implement some lines of PHP to insert the JavaScript initialization into the HTML head element.

Here is how the PHP script roughly looks:

SyntaxHighlighter to highlight code snippets within WordPress. Supports C++, C#, CSS, Delphi, Java, JavaScript, PHP, Python, Ruby, SQL, VB, XML, and HTML. Read   for usage directions.
Version: 0.1
Author: Martin Ahrer
Author URI: http://www.martinahrer.at
*/

function insert_header() {
	$current_path = get_option('siteurl') .'/wp-content/plugins/' . basename(dirname(__FILE__)) .'/';

?>
	
	
	
	




	




The next step will be to package this and make it available for download!

Google Syntax Highlighter

This morning I have updated my blog to use a new syntax highlighter with a very appealing appearance. You can get it from http://alexgorbatchev.com/wiki/SyntaxHighlighter.

For now I just addded the code to wp-content/syntaxhighlighter and inserted the following HTML code to my theme header template


























Next I will try to convert this setup into a wordpress plugin so it will survive changes of theme etc.

WP-Syntax plugin styles

I’m using the wp-syntax plugin to get these nicely formatted code boxes for a variety of programming languages. These are the CSS definitions that must be included in a theme:

.wp_syntax {
  color: #100;
  background-color: #f9f9f9;
  border: 1px solid silver;
  margin: 0 0 1.5em 0;
  overflow: auto;
}

/* IE FIX */
.wp_syntax {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: expression(this.scrollWidth > this.offsetWidth ? 15 : 0);
  width: 100%;
}

.wp_syntax table {
  border-collapse: collapse;
}

.wp_syntax div, .wp_syntax td {
  vertical-align: top;
  padding: 2px 4px;
}

.wp_syntax .line_numbers {
  text-align: right;
  background-color: #def;
  color: gray;
  overflow: visible;
}

/* potential overrides for other styles */
.wp_syntax pre {
  margin: 0;
  width: auto;
  float: none;
  clear: none;
  overflow: visible;
}

Upgrade to ShareThis 2.0

I had used ShareThis 1.4 for a while in my blog but had problems with displaying the icon next to the SharThis link. Today I upgraded to version 2.0 and everything is working fine now.

Back to blogging

I haven’t had a lot of blogging activity for a while – simply I have been on vacation and then been fairly busy with catching up with client projects.
But I’m back now and did some maintenance to my blog system:

  • Upgrade to WordPress 2.3
  • Activated the akismet spam filter – spam just got to intensive and annoying
  • Setup permalinks to get nice links to my postings

green red blue grey