Search
Sponsors

Archive for the ‘Wordpress’ Category

Display categories

Saturday, August 9th, 2008

This will display categories in Wordpress, note that for SEO an <H1> tag would be better for the categories text.

<h2>Categories</h2>
<ul>
<?php wp_list_cats('sort_column=name'); ?>
</ul>

Dynamic title tag in Wordpress

Saturday, August 9th, 2008

OK here goes for the example

<title>
<?php
if (is_home()) {
	echo bloginfo('name');
} elseif (is_404()) {
	echo '404 Not Found';
} elseif (is_category()) {
	echo 'Category:'; wp_title('');
} elseif (is_search()) {
	echo 'Search Results';
} elseif ( is_day() || is_month() || is_year() ) {
	echo 'Archives:'; wp_title('');
} else {
	echo wp_title('');
}
?>
</title>
Translate