I've this function at functions.php
file:
function custom_secondary_nav( $menu_name, $id = '', $menu_title = '' )
{
global $wp_query;
// others stuff goes here
if (is_object($wp_query)) {
$wpQueryObj = get_object_vars($wp_query);
if (in_array("queried_object", $wpQueryObj)) {
$query_name = $wp_query->queried_object->name !== "" ? $wp_query->queried_object->name : "";
}
}
}
But all the time I'm getting this PHP Warning:
PHP Notice: Trying to get property of non-object in /var/www/vhosts/elclarinweb.com/httpdocs/sistema/wp-content/themes/elclarin_v2/functions.php on line 86
How I can fix that small issue?