Query categories that have a description

How about looping all available terms, if term has description, add to to an object_ids, something like this. add_filter( ‘wp_sitemaps_taxonomies_query_args’, function( $args, $taxonomy ) { // Show in sitemap categories and topics that have a description if ( $taxonomy == ‘category’ || $taxonomy == ‘post_tag’ ) { // get the terms of the taxonomy $terms … Read more

Is there a JavaScript equivalent of get_post_field?

The @wordpress/hooks package only gives you a JS-like equivalent to the PHP-based hook system in WordPress – they are entirely separate, and don’t bring any native WP PHP functions to the table. What you need (most likely) is an AJAX request to the WordPress REST API. Specifically, the GET posts endpoint, which by default is: … Read more

Append a code when at the current page in wp_list_pages()

I would use a custom walker and then extend the Walker_Page::start_el() method, like so: // Based on Walker_Page for WordPress v6.0 // @link https://github.com/WordPress/wordpress-develop/blob/6.0/src/wp-includes/class-walker-page.php#L105-L219 class My_Walker_Page extends Walker_Page { public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { /* This checks if the current page in the list … Read more

Need to check is_archive during init

This is what I could come up with, within init like you said ! Even if you print the $GLOBALS array, there is no way to check if the current page is an archive, is_archive is also set to blank! But if you check the $_GET array, the q variable contains the current archive type … Read more

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