Quintic
WordPress Cheat-Sheet

Page or Post

is_page() // Returns true if a page
is_single() // Returns true if a single post
is_singular() // Returns true if any type of sinle item (Post, Page, Attachment, Custom post 

Post / Page with given Caterogy

$categories = get_the_category();
  if ( ! empty( $categories ) ) 
  {
	foreach ( (array) $categories as $category ) 
	{
	  $peers = get_posts(array('category' => $category,
				  'exclude' => $post->id));

Leave a Reply

Your email address will not be published. Required fields are marked *