Is there a is_ function for sitemaps?

There is no is_sitemap() core function in WP < 6.8, but there is a ticket for it here. The rewrite rules for the sitemap (src) use e.g. the sitemap query variable: add_rewrite_rule( ‘^wp-sitemap\.xml$’, ‘index.php?sitemap=index’, ‘top’ ); add_rewrite_rule( ‘^wp-sitemap-([a-z]+?)-([a-z\d_-]+?)-(\d+?)\.xml$’, ‘index.php?sitemap=$matches[1]&sitemap-subtype=$matches[2]&paged=$matches[3]’, ‘top’ ); add_rewrite_rule( ‘^wp-sitemap-([a-z]+?)-(\d+?)\.xml$’, ‘index.php?sitemap=$matches[1]&paged=$matches[2]’, ‘top’ ); The get_query_var( ‘sitemap’ ) is checked within the template_redirect … Read more

How to include empty terms into wp-sitemap.xml?

Use the wp_sitemaps_taxonomies_query_args hook to set hide_empty to false: add_filter( ‘wp_sitemaps_taxonomies_query_args’, function ( $args ) { $args[‘hide_empty’] = false; return $args; } ); Explanation The list of terms in the site map is generated by the WP_Sitemaps_Taxonomies::get_url_list() method. The terms are queried in this method using the get_taxonomies_query_args() method to build the args for WP_Term_Query: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)