Skip to content

Instantly share code, notes, and snippets.

@Viper007Bond
Created November 28, 2012 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Viper007Bond/4158778 to your computer and use it in GitHub Desktop.
Save Viper007Bond/4158778 to your computer and use it in GitHub Desktop.
<?php
$current_category = get_queried_object();
if ( $current_category->category_parent ) {
$parent_category = get_category( $current_category->category_parent );
$parent = $parent_category->name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment