name; } elseif (is_day()) { $title = sprintf(__('Daily Archives: %s', 'virtue'), get_the_date()); } elseif (is_month()) { $title = sprintf(__('Monthly Archives: %s', 'virtue'), get_the_date('F Y')); } elseif (is_year()) { $title = sprintf(__('Yearly Archives: %s', 'virtue'), get_the_date('Y')); } elseif (is_post_type_archive()) { $title = get_queried_object()->labels->name; } else { $title = get_the_archive_title(); } } elseif (is_search()) { $title = sprintf(__('Search Results for %s', 'virtue'), get_search_query()); } elseif (is_404()) { $title = __('Not Found', 'virtue'); } else { $title = get_the_title(); } return apply_filters('kadence_title', $title); } /** * Return WordPress subdirectory if applicable */ function wp_base_dir() { preg_match('!(https?://[^/|"]+)([^"]+)?!', site_url(), $matches); if (count($matches) === 3) { return end($matches); } else { return ''; } } /** * Opposite of built in WP functions for trailing slashes */ function leadingslashit($string) { return '/' . unleadingslashit($string); } function unleadingslashit($string) { return ltrim($string, '/'); } function add_filters($tags, $function) { foreach($tags as $tag) { add_filter($tag, $function); } } function is_element_empty($element) { $element = trim($element); return empty($element) ? false : true; }