How to restrict sidebar element to homepage in Wordpress

September 22nd, 2011 by admin

Use the following code to restrict a piece of sidebar content to the homepage (so that it does not appear sitewide) in Wordpress:

In sidebar.php, add the following:

<?php if (is_home())

{
some PHP code
}

?>

That’s it!

Posted in Coding | No Comments »

How to add PHP code to Phplinkdirectory

September 22nd, 2011 by admin

Use {php} {/php} instead of <?php   ?>

i.e.,

replace <?php with {php}

and

?> with {/php}

Example:

{php}
echo “This is php code included in .tpl<br />”;
{/php}

Posted in Coding, Web Design | No Comments »