Tag Info

Hot answers tagged

2

You can specify multiple categories within has_category like so: if ( has_category( array( 'category_1', 'category_2' ) ) { // do something } However, I am not sure if this acts as AND or OR, meaning does it require that ALL categories specified are matched, or one of the X supplied (category_1 OR category_2). In any case, your syntax should work ...


1

If your first query works you can try something like this : function get_post_by_id($id){ $content = array(); foreach ($id as $key => $value) { $post_content = get_post($value); $content[]=$post_content->post_content; } return $content; } Cheers, phpbits


1

If you can add your code, It may help for everyone. By reading you question. By default normally that get_category_link is have to work. Just use global $post before your loop. If is not work. What you have to do is. Grab the category id using your @category variable. (you can use print_r($category); or var_dump($category); after your code $category = ...



Only top voted, non community-wiki answers of a minimum length are eligible