Skip to content
WJunction - Webmaster Forum

i want to convert a php code !

Status
Not open for further replies.
hi

i need a small help from you guys

Code:
<?php $this_category = get_category($cat);   if($this_category->[COLOR=#ff0000][B]category_parent == 0)[/B][/COLOR] { include (TEMPLATEPATH . '/cat-featured.php'); } ?>

the above code, i want to edit it, instead of calling the cat-featured in all "parent categories" i want to call it in specific cats depends on IDs

any help ?
 

3 comments

PHP:
<?php 
$categories_to_show = array(1,2,3) // Categories ID's 
$this_category = get_category($cat);  

if(in_array($this_category->category_parent, $categories_to_show))
   include (TEMPLATEPATH . '/cat-featured.php'); 
 ?>
 
Status
Not open for further replies.

About the author

D
Active Member · Joined
2,777
Messages
589
Reactions
113
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom