Problems with function on function.php

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 );
function wpse27111_tester()
$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

Leave a Reply

Your email address will not be published. Required fields are marked *