Posts for the ‘Wordpress’ Category

Latest Comments for this category:

2010-09-01 06:54:19 | wow nice script.
2010-09-01 01:04:27 | It doesn't work for me... but hey I am no programmer, I just follow in ...
2010-08-28 20:27:20 | Hi Jon, how would the default graphic look like? and what is showing ...
2010-08-27 17:26:19 | Thanks for this mate. You have just resolved a day long problem I've b ...
2010-08-27 14:32:39 | Hey, great job on the script! I'm using this for a site and it work ...

35 | Front Page Comments on your WordPress Blog

Posted by alchymyth | Tips & Tricks,Wordpress | Monday 2 August 2010

You want to show the comments to the posts on the front page of your blog?
You want to allow visitors to your blog to leave a comment on the latest post without having to click on the comments link or the post title?
You think this should be straight forward and easy to do?
But far from it…
First step is to locate the template file that shows your front page: in most cases,
this is index.php (but … » read more »

34 | Image Rotator for the Header of Twentyten

Posted by alchymyth | Tips & Tricks,Wordpress | Saturday 24 July 2010

The wp3 default theme TwentyTen comes with a choice of header images, which can be selected from the dashboard.
To rotate these images to show randomly in the header, we can make use of the global array variable which stores all the default header image information: $_wp_default_headers.
The rest is easy: we build a function, which we later save in functions.php of TwentyTen, to pick a random image out of the available images:
function rotate_default_headers() {
global … » read more »

33 | Automatically Shorten the Manual Excerpt

Posted by alchymyth | Tips & Tricks,Wordpress | Saturday 10 July 2010

When you are building or modifying a wordpress theme, you have the choice of either using ‘the_content()’ to show the full article, or ‘the_excerpt()’ to show a shorter version.
By default, the latter limits the output to the first 55 words of the post, and automatcally strips formatting and images.
To make things more flexible, the editor also allows you to add a manual excerpt that will have preference before the automatically generated one.
There is no default … » read more »

31 | Adsense in Content of Posts and Pages for wp3

Posted by alchymyth | Tips & Tricks,Wordpress | Wednesday 23 June 2010

A flexible way to add google adsense into posts and pages in your wordpress blog.
This appraoch uses shortcodes which are an underused technique of increasing the functionality of themes.
Through the formatting options in the shortcode, the text can flow around the adsense blocks similar as it would happen with inserted images.
Options for the alignment are ‘left’, ‘center’, ‘right’ – anything else will be treated as ‘none’.
The code that needs to be added to functions.php of … » read more »

30 | TwentyTen – make header image link to ‘home’

Posted by alchymyth | Wordpress | Sunday 20 June 2010

WordPress3 is out, and with it the new default theme TwentyTen.
Having the whole header image linking to the home page is one of the most common things of a theme, however this is not the standard behaviour of TwentyTen.
It is easy to remedy:
(edits are to be made in header.php of TwentyTen)
<div id="site-description"><?php bloginfo( 'description' ); ?></div>
<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<?php
// Check if this … » read more »

29 | Advanced styling of the prev/next post links

Posted by alchymyth | Tips & Tricks,Wordpress | Wednesday 9 June 2010
prev_next_link

when you use the ‘previous/next post’ navigation in single posts, you will have noticed that these links appear empty when there is no previous or next post, as for the latest and the first article.
to keep your page design and to style these occurences by showing a special image or text, you can make use of the virtually undocumented wordpress function ‘get_adjacent_post()’.
see this screenshot of the navigation in a single post page:

the example below is … » read more »

28 | Defining the writing area of the dashboard editor

Posted by alchymyth | Tips & Tricks,Wordpress | Tuesday 18 May 2010

the first of my upcoming ‘tips and tricks’ – a handy function to style the editor area of your self-hosted wordpress blog or cms:
if you are working on a modern widescreen monitor, but want to restrict the wordpress editor area (your writing paper, so to speak) to the width as it will later show in your blog, here is a tip what to add to functions.php of your theme:
function custom_max_width_editor() {
echo '<style type="text/css"> textarea#content, #content_ifr … » read more »

27 | Highlight the post’s categories in the category list

Posted by alchymyth | Wordpress | Monday 17 May 2010

highlighting the categories of a post in single post view is a useful trick to allow the viewer to find related posts.
there are plugins available which extend the functionality of the standard category widget to do this.
sometimes, however, it can be desirable to have the same feature with a function that you can use like you would use ‘wp_list_categories();’ – exactly with the same arguments.
/* hi_list_categories() to highlight the current categories of a post in … » read more »

26 | Playing with columns – stacking posts in a grid

Posted by alchymyth | Wordpress | Sunday 11 April 2010

a different approach to ‘grid style’ – stacking the posts in a tightly ordered grid; to get a similar design as in http://www.creativedepart.com/ – ideal to use with thumbnails and excerpts:
(bare minimum code, without explanation, totally flexible and automatic)
<?php $num_cols = 4; // set the number of columns here
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; // for pagination
$args = array(
'posts_per_page' => 16, // optional to overwrite the dashboard setting
'cat' => 0, // add any other … » read more »

25 | Continuous post numbers for your blog

Posted by alchymyth | Wordpress | Saturday 27 March 2010
post_numbers

if you look at my blog, you may notice that all posts are numbered with a unique number – starting with 1 for the oldest post and increasing continuous for each published post.
how is it done?
with a function that is hooked to some wordpress core actions:
function updateNumbers() {
/* numbering the published posts: preparation: create an array with the ID in sequence of publication date, /
/ save the number in custom field 'incr_number' of post … » read more »

24 | Different header image for each page in wordpress

Posted by alchymyth | Wordpress | Sunday 14 March 2010

how to show a different image for each page, for instance in the header?
simple, all you have to do with this method is to create an image file with the page ID as part of the image name.
the code for this is really short:
<?php $page_id=get_the_ID();
if(is_page()) { $image='head-image-'.$page_id.'.jpg'; };
if(!file_exists(TEMPLATEPATH.'/images/'.$image)) { $image='head-image.jpg'; }
echo '<img src="'.get_bloginfo('template_url').'/images/'.$image.'"/>'; ?>
this is all.
first step: create an image file name including the page ID (on pages only);
second step: check if a matching image … » read more »

23 | Troubleshooting wordpress themes

Posted by alchymyth | Wordpress | Wednesday 3 March 2010

here is a little trick if you need to check some variables, or try something new in your wordpress theme while the site is live.
use a conditional if statement to check that you are logged in as the original administrator, and only then do what you need to do. this way you can perform and display the neccesary tests, without the public seing anything.
<?php
if (’1′ == $user_ID) :
echo 'you … » read more »

22 | Multi-Column Grid-Style Posts in WordPress

Posted by alchymyth | Wordpress | Friday 29 January 2010
a three column grid category template

following question comes up regularly in the wordpress support forum: ‘i want to show my posts in three (four, five) columns, how can i do it?’
see the effect here in action: under pages ‘grid of posts’.
EDIT:
as this code can have its challenges, and is not always easy to apply, i would like to point to another approach with the same results:
Playing with columns – stacking posts in a grid.
END of EDIT
here, i am going  to … » read more »

21 | Hyperlinks in wordpress image captions

Posted by alchymyth | Wordpress | Sunday 17 January 2010
one million dollars, copyright silkandart

have a look at the image above and check the link within the image caption.
nice feature?
as many of you might have experienced before, the image caption function of wordpress filters all html content, including any attempts to insert  links.
however, this functionality would come very handy, if you want to credit the copyright owner of the image (which could obviously be yourself) by providing a one-click connection to their website.

20 | Zebra style wordpress loop

Posted by alchymyth | Wordpress | Thursday 14 January 2010

to start, i would like to express my thanks and gratitude to all the volunteers in the wordpress forum who patiently and freely give their time and attention, and share their knowledge and experience with all the users coming with questions and problems about their wordpress installation and modifications.
a great community.
lists or posts styled with alternating color backgrounds, for instance, can inprove the readability of blogs.
most themes and the standard wordpress installation are not offering … » read more »

19 | WP default theme in 3 columns

Posted by alchymyth | Wordpress | Saturday 2 January 2010
3 column kubrick theme

Part of my time, I am spending designing and troubleshooting wordpress themes.

This is my latest ‘hack’, turning the default theme that comes with every wordpress installation, into a 3 column version, with equal sized left and right sidebar columns, all dynamic and widget ready.
All functions of the default theme are fully preserved. You can still modify the header colours from within the dashboard.
All files and graphics zipped for download. A great start for learning to … » read more »