If post is over 100 it wont show in query
-
Hi,
I have a custom field “count_view”, updated every page load.
However, when a post gets over 100 views it disappears from query?
add_action( 'elementor/query/most_popular_filter', function( $query ) { $query->set( 'orderby', 'meta_value' ); $query->set( 'meta_key', 'count_view' ); $query->set( 'order', 'DESC' ); } );
function child_theme_head_script() { if (is_singular('post')) { $views = get_field('count_view'); $views++; update_field('count_view',$views); } } add_action( 'wp_head', 'child_theme_head_script' );
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘If post is over 100 it wont show in query’ is closed to new replies.