Hi I am tring to include a style option in wordpress to instantly assign the right template to particular groups and single image templates.

I've my theme option built in which a user can enter category amounts separated having a coma and that i have modified the only.perl template to see if the only publish is for the reason that category however the template isn't being acquired.

<?php
$catArr = get_option('scp_gallery_cats');

if (in_category( array($catArr)))
{
    include (TEMPLATEPATH . '/single-image.php');
}
else { 
    include (TEMPLATEPATH . '/single-other.php');
}
?>

Any help could be appreciated

Try carrying out a print_r($catArr) may be the comma-separate listing of groups one string, or perhaps is each category another value within the array?

If $catArr is really a string and never an assortment, you will need to make a move like:

$catArr = explode(",", $catArr);

Because of the below comment, I believe you need to break the worthiness into an assortment try the next code:

<?php
$catArr = get_option('scp_gallery_cats');
$catArr = explode(",", $catArr); //break the string into array keys!
if (in_category($catArr))
{
    include (TEMPLATEPATH . '/single-image.php');
}
else { 
    include (TEMPLATEPATH . '/single-other.php');
}
?>

Hope this can help!

<?php
global $options;
global $post;
ob_start();
$catArr = print_r(get_option('scp_gallery_cats'),false);
ob_end_clean();
if (in_category('1')) {
  include(TEMPLATEPATH.'/single-image.php.php');
} elseif (in_category (array(($catArr))){
  include(TEMPLATEPATH.'/single_other.php.php');
} else {
  include(TEMPLATEPATH.'/single_default.php');
}
?>