Code to pull in a PHP file named after the category ID
<?php foreach((get_the_category()) as $category) { if( file_exists( ‘/path/to/file/to/include/’ . $category->cat_ID . ‘.php’ ) ) include( ‘/path/to/file/to/include/’ . $category->cat_ID . ‘.php’ ); } ?> That should do the trick. If the file doesn’t exist, it just skips it. This can be expensive to do if you have a large amount of categories to loop through, though. … Read more