Skip to content
WJunction - Webmaster Forum

i want to convert a php code !

Status
Not open for further replies.

D4rk

Distinguished Member
2,777
2010
589
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
Distinguished Member · Joined
2,777
Messages
589
Reactions
113
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom