0
votes

Since I have a blog in blogger(it is a images blog), so I recently moved to wordpress.

After importing all posts from blogger to wordpress it is showing post thumbnail image in single post along with the post original image. So I changed the template. It good working for all imported posts.

But I posted many posts after came to wordpress using a plugin for bulk posting. That template showing thumbnail images in main page , category page etc.. But in single post it is not showing original image.

So I changed template again. Now the images are not showing in imported posts (single post).

So I decided to show separate single.php codes for each category.

So what I need is: I gathers these 2 codes.

  • code 1:- (single.php of 1st template)
  • code 2:-(single.php of 2nd template)

Here I am copying these 2 codes.

In a template single.php code(what ever the template may be) I like to write if condition to solve my problem. I will tell you algorithm but please write the if condition code please. ............

Algorithm:

if( categeory_id=14 or 15 or 16 or 17) 
Code 1 here.
else
code 2 here.

Thanks to all developers. If it is not possible please suggest me a good gallery theme.

Thanks in advance.

1

1 Answers

1
votes

This should work:

<?php if (is_category( array( 14,15,16,17 ) ))
{
    //Code here
}
else
{
    //other code
}
?>

In the array put the id of the category. If a category isn't in that array then it will run the other code.