Skip to content

Instantly share code, notes, and snippets.

@Spellhammer
Created November 13, 2020 17:00
Show Gist options
  • Save Spellhammer/758135281eafee8d29ef05aac585c929 to your computer and use it in GitHub Desktop.
Save Spellhammer/758135281eafee8d29ef05aac585c929 to your computer and use it in GitHub Desktop.
isotope.category.codeblock.php
<?php
$categories = get_the_category(get_the_ID());
foreach( $categories as $category ) {
echo "<span class='category'>$category->slug</span>";
}
?>
@MarkHuyton
Copy link

Hi
I have a taxonmy 'location' where the user can select a location where the live, i put the code above in the repeater code block replacing 'my_taxonomy' with 'location' I then have 3 buttons with different locations, what code is used the the main code block?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment