How to display total views of all posts of one category?

<?php $QUERY = new Wp_query(array( ‘post_type’ => ‘post_type_here’, ‘category_name’ => ‘category_name_here’, // you can use cat id … )); $counter = 0; while( $QUERY->have_posts() ) : $QUERY->the_post(); $views = absint( getPostViews( $post->ID ) ); $counter += $views; endwhile; wp_reset_postdata(); echo $counter; ?> getPostViews() and setPostViews : function getPostViews( $postID ){ $count_key = ‘post_views_count’; $count = … Read more

How to toggle custom WP archive list

I know nothing about the theme or plugins you are using. Since your theme isn’t responsive you could get away with the down and dirty approach if you can edit CSS files: /wp-content/themes/mytable/style.css line 262 .content-bar { border-right: none; width: 890px; } /wp-content/themes/mytable/style.css line 181 .right-sidebar { display: none; } Or override by adding your … Read more

How can I generate a list of post-type specific categories?

You can create a template page and use the WP loop: taxonomy-{taxonomy}-{term}.php https://developer.wordpress.org/themes/template-files-section/taxonomy-templates/ Or you can use the get_posts functionality: https://codex.wordpress.org/Template_Tags/get_posts#Taxonomy_Parameters Something like this maybe: <?php $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘reports’, ‘my_custom_taxonomy_name’ => ‘education’, ‘post_status’ => ‘publish’ ); $show_albums = get_posts( $args ); ?> This will return a list of posts … Read more

Multi level archive

This is a direction. Not tested but you have an idea. <?php // get current term $term = get_term_by( ‘slug’, get_query_var(‘term’), get_query_var(‘taxonomy’) ); // get parent term $parent = get_term($term->parent, get_query_var(‘taxonomy’) ); // get children $children = get_term_children($term->term_id, get_query_var(‘taxonomy’)); $taxonomy = ‘business-types’; if ( empty($parent->term_id) ) { echo ‘<a href=”‘ . esc_url( get_term_link( $term ) … Read more

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