I'm building a website in Wordpress and wish to have a list of catogories on a seperate page which acts as a filter for the isotope plugin. So far i've managed to get this working however i now need to remove the phrase "academia" from each category as this is can only be seen in the backend of wordpress but when trying to use str_replace it doesn't render any results.
Is anyone kind enough to some help? :)
link to website : http://www.bluemoontesting.co.uk/intbauwp/testing/#
<?php
$terms = get_categories('orderby=name&depth=1&title_li=&use_desc_for_title=1&parent=34'); // get all categories, but you can use any taxonomy
$remove = str_replace("academia","", $terms);
$count = count($remove); //How many are they?
if ( $count > 0 ) { //If there are more than 0 terms
foreach ( $terms as $term )
{ //for each term:
echo "<li><a href='#' data-option-value='.".$term->slug."'>" . $term->name . "</a></li>
";
//create a list item with the current term slug for sorting, and name for label
}
}
?>