Skip to content

Instantly share code, notes, and snippets.

@furahaclothing
Created February 10, 2013 13:03
Show Gist options
  • Save furahaclothing/4749529 to your computer and use it in GitHub Desktop.
Save furahaclothing/4749529 to your computer and use it in GitHub Desktop.
wordpress-スラッグからタクソノミー情報を取得する-
/*IDの取得*/
<?php echo get_term_by('slug',$term,$taxonomy)->term_id ?>
/*名前の取得*/
<?php echo get_term_by('slug',$term,$taxonomy)->name ?>
/*説明の取得*/
<?php echo term_description(get_term_by('slug',$term,$taxonomy)->term_id,$taxonomy); ?>
/*URLの取得*/
<?php echo get_term_link($term,$taxonomy); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment