Displaying on different post categories
-
In https://talkbinary.com the homepage does not display what I want, which is good.
If you click on C++ ( https://talkbinary.com/category/c/ ) you are taken to the category-3.php result which contains a different sidebar (contains a navigation for C++ tutorials).
Now when they click on ( https://talkbinary.com/2008/06/start-programming-in-c/ ) which is a post of category-3.php as mentioned above, the sidebar is not present because it’s calling single.php
I tried using this below…
<?php
$arr = wp_get_post_categories( the_ID() );
print_r($arr); ?><?php if ( $arr[0] == ‘C++’ ) { ?>
<?php include (TEMPLATEPATH . ‘/navi/cpp.php’); ?>
<?php } ?>
but print_r only displays the ID and not the post categories
Can anyone help me? Thank you.
- The topic ‘Displaying on different post categories’ is closed to new replies.