Get the total Author Favorited posts

<?php $args22 = array( ‘post_type’ => array (‘menus’, ‘recipes’ ), ‘author’ => get_queried_object_id(), ‘meta_query’ => array( ‘meta_key’ => ‘simplefavorites_count’, ‘value’ => ‘0’, ‘compare’ => ‘>=’, ), ); $my_query = new WP_Query( $args22 ); echo ‘Found posts: ‘ . $my_query->found_posts . ‘<br />’; // declare variable and set total votes to 0 $total_fav_count = 0; if … Read more

number of posts with “Load More”

You can get the (current) displaying posts number from offset number. As it’s an ajax load more for wp post, it should has the offset numbers. So, you can display the number like this Javascript var offset = 4; return $.ajax({ url: ajaxurl, type: “POST”, data: data, success: function(returnData) { // diplay offset number in … Read more

Counting Posts by Category

0 down vote accepted I think it would help you to read this => http://wordpress.org/support/topic//display-number-of-posts-per-category function number_postpercat($idcat) { global $wpdb; $query = “SELECT count FROM $wpdb->term_taxonomy WHERE term_id = $idcat”; $num = $wpdb->get_col($query); echo $num[0]; }

Display Custom Post Category Count & WordPress Category Count Using Shortcode

It’s because you are have passed “category” in “get_terms_by()” function as third argument. Please replace “add_custom_taxonomy_here” with your custom taxonomy slug in below code. // Add Shortcode to show posts count inside a category function category_post_count( $atts ) { $atts = shortcode_atts( array( ‘category’ => null ), $atts ); // get the category by slug. … Read more

How to get the total count of Favorite/Favorited authors

This will help you to show how many author current user favorite others: Add this to your themes functions.php file <?php function get_fav_auth_count(){ if ( is_user_logged_in() ) { global $current_user; wp_get_current_user(); $count = size_of(get_user_option(‘favorite-authors’, $current_user->ID)); echo $count; } } ?> and call it like this <?php get_fav_auth_count(); ?>

How to count posts in tags within time limit

WP Core doesn’t have a way to pull tags by how many posts were published associated to a tag in a given time period. You’ll need to roll your own solution. Use $wpdb->prepare as a best practice; the Codex article on the wpdb class should give you the info you need to run the query … Read more

Count singular post views automatically

You could hook into template_redirect and execute a helper function: add_action( ‘template_redirect’, ‘wpse_75558_count’ ); function wpse_75558_count() { if ( is_singular() ) setPostViews( get_the_ID() ); } To display the post views, you have to use a later hook. I would recommend the_content: add_filter( ‘the_content’, ‘wpse_75558_show_count’ ); function wpse_75558_show_count( $content ) { $count = getPostViews( get_the_ID() ); … Read more

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