Count words for all posts by all authors

You will need a function to get all the published posts and count the words. function wpse410818_count_published_words() { $posts = new WP_Query(array( ‘post_type’ => array( ‘post’ ), ‘post_status’ => ‘publish’, )); $count = 0; //Starting words count if ( $posts->have_posts() ) { while ( $posts->have_posts() ) { $posts->the_post(); //Add to the word count $count += … Read more

Incorrect posts displayed on category page

First of all, never ever make use of query_posts. It is not just slow and reruns queries, but it breaks pagination, page functionalities and the globals like $post on which some theme functionalities and plugins rely. If you really need to run custom queries (which is totally unnecessary in this case), make use of WP_Query … Read more

How to get Custom post type by related category ID

After two days with this problem have resolved the problem, I fix it adding tax_query parameter with my taxonomy name and slug of the category requested: $args = array( ‘post_type’ => array ( ‘servicios’ => ‘servicios’, ), ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘dgit’ ) ) );

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