ok so just to be clear,
put this:
if( function_exists( 'stats_get_csv' ) ) {
$top_posts = stats_get_csv( 'postviews', 'period=month&limit=30' );
}
inside the post template, even though jetpack already exists and runs this action as a plugin?
another question is, I am unclear of what to put here:
// Posts or Portfolio Widget
add_action( 'elementor/query/my_custom_filter', function( $query ) {
---- HERE----- // Modify the posts query here ----- HERE
} );
based on the link, it sounds like something like this:
// Posts or Portfolio Widget
add_action( 'elementor/query/my_custom_filter', function( $query ) {
$query = array(
[0] => array(
['post_id'] => 0
['post_title'] => 'Home page'
['post_permalink'] => 'https://www.example.com/'
['views'] => 6806
)
[1] => array(
['post_id'] => 8005
['post_title'] => 'Hello World!'
['post_permalink'] =>
['views'] => 1845
)
/* till item [29] */
} );
not sure if this would be accurate?
Thanks a lot for the reply!
-
This reply was modified 3 years, 11 months ago by chaimsem.
-
This reply was modified 3 years, 11 months ago by chaimsem.