Custom global variable not working in function

I try to use this code and for the if statments I had to put a global $query_obj before the code, I do not know if is the case. global $query_obj; if ( is_a($query_obj, ‘WP_Term’) ) { $my_base_url = get_term_link($query_obj); } elseif ( is_a($query_obj, ‘WP_Post’) ) { $my_base_url = get_permalink(); } else { $my_base_url = … Read more

HTML comment cause issue in functions.php script root

The functions.php is loaded before WordPress has sent the HTTP response headers. If you have raw HTML content in that file, even a HTML comment, then that will be sent immediately, triggering PHP’s built-in HTTP headers. Now, WordPress doesn’t know about this and tries to send the headers as usual. And that will cause an … Read more