Variable Sidebar Content Problem
-
Hi,
I’ve read Variable Sidebar Content Example in https://codex.www.ads-software.com/Conditional_Tags anh try to follow it. So I wrote these code in sidebar.php:<?php
if (is_single())
{
echo ‘This is Single!’;
}
elseif (is_home())
{
echo ‘This is home!’;
}
elseif (is_category())
{
echo ‘This is category!’;
}
else
{
echo ‘This is not single!’;
}
?>Then, when I was in home page, it showed “This is Home” (correct), But when I viewed catagory page, it showed “This is Home” (incorrect) and when I viewed single post, it still showed “This is Home” (incorrect).
What’s the problem? And how to solve this?
- The topic ‘Variable Sidebar Content Problem’ is closed to new replies.