How to display the past events in one of the category?

you would need to use the date query: $args = array ( ‘cat’ => ‘1234’, // if category being used ‘post_type’ => ‘events’, // if custom post type ‘paged’ => get_query_var(‘paged’), ‘order’ => ‘DESC’, ‘paged’ => $paged, ‘date_query’ => array( // this is the thing you need array( ‘before’ => array( // this is ‘before … Read more

Category next page link not working

I may be jumping to a conclusion without seeing your code first. But I believe this may simply be because the way have your permalinks setup. If you go to your dashboard then settings->permalinks and change the option to anything other than Plain.

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 relocate images

I had to code an external program, I can’t see any other way. I used Java JDBC in my case. Query: SELECT p.post_title, m.meta_value FROM wp_term_taxonomy tt INNER JOIN wp_term_relationships tr on tt.term_taxonomy_id = tr.term_taxonomy_id inner join wp_posts p on p.ID = tr.object_id inner join wp_posts p2 on p.ID = p2.post_parent inner join wp_postmeta m … Read more

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