I’ve a problem with some functions on function.php. I want to use get_tems_by(“slug”, $slug, “category”); but it doesn’t work inside a function on function.php. When i changed slug by ID and give a random ID it’s work.
I’m sure that the slug exist.
I’ve also try that :
add_action( ‘init’, ‘wpse27111_tester’, 999 );
$term = get_term_by(‘slug’, ‘some-term’, ‘some-taxonomy’);
And it’s work but i need to put $slug
If you have a solution please tell me.
Read more here:: Problems with function on function.php