Ajay on "[Plugin: Top 10 - Popular posts plugin for WordPress] Show taxonomy and custom field"

ساخت وبلاگ

Thanks for the quick reply,

I installed manually the plugin and used the fetch function that you suggested.

The issue that I'm having now is that anything is showing as the top posts. I printed step by step the function and the problem seems to be in the loop area.

I'm using this, but I'm not getting anything on the page.

<?php
/*
* This example fetches the popular posts tracked by Top 10.
*
*/ if ( function_exists( 'get_tptn_pop_posts' ) ) { $settings = array( 'daily' => TRUE, 'daily_range' => 30, 'limit' => 20, 'strict_limit' => FALSE, ); $topposts = get_tptn_pop_posts( $settings ); // Array of posts $topposts = wp_list_pluck( (array) $topposts, 'postnumber' ); //print_r($topposts); $args = array( 'post__in' => $topposts, 'orderby' => 'post__in', 'posts_per_page' => 5, 'ignore_sticky_posts' => 1 ); //print_r($args); $my_query = new WP_Query( $args ); if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $my_query->the_post(); echo '<a href="' . get_permalink( get_the_ID() ) . '">'; the_title(); echo '</a>'; wp_reset_postdata(); } } else { } wp_reset_query(); } ?>

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 210 تاريخ : دوشنبه 10 خرداد 1395 ساعت: 6:56