PHP

PHP Code in Footer Attribution of Thesis 2+ WordPress Theme

In Thesis 2+ WordPress theme, if you need to have PHP Code in Footer Attribution, you need to add a code in Thesis 2+ Custom Function. You may need this to automatically change the year in the copyright of the footer instead of manually change it every year. The best thing is the code will apply to all post, page or archive page.

In Thesis 2+ theme, there are 2 ways to do it. If you want the Custom Function to apply to all Thesis 2+ Skins, edit “/wp-content/thesis/master.php” file. However if you want the function to apply to only individual Skin, edit “/wp-content/thesis/skins/SKIN/custom.php” file. “SKIN” is referring to your selected skin.

If you want to change the year in the copyright in the footer automatically, add the following code.

/* Footer Text */
function my_footer() {
	?>
		<p>Copyright &copy; 2011 &ndash; <?php echo date("Y"); ?>
		<a href="/">example.com</a></p>
	<?php
	}
add_action('hook_top_footer', 'my_footer');

Remove Category-Location at Sitemap & Listing of phpMyDirectory

phpMyDirectory (PMD) is a great directory software. You can browse listings via Category, Location or Category-Location. However, for some directory, it is not necessary to have category-location as many of them do not contain any listing. This may give poor SEO.

If your directory falls under this category, you may want to disable Category-Location in the Sitemap & Listing Page. To disable there are 3 files that you need to modify.

1. /xml.php

Find this code

if($categories_count > 0 AND $locations_count > 0) {

Replace it with

if($categories_count > 0 AND $locations_count > 0 AND FALSE) {

 

2. browse_categories.tpl – in template directory

Find this code

<?php if($location_columns) { ?>

Replace it with

<?php if($location_columns AND FALSE) { ?>

 

3. browse_location.tpl – in template directory

Find this code

<?php if($category_columns) { ?>

Replace it with

<?php if($category_columns AND FALSE) { ?>