I just should make
Method 1
$object->set('meta_key', 'post_views_count');
Method 2
$query->set( 'meta_key', 'post_views_count' );
Method 3
$vars['meta_key'] = 'post_views_count';
Related Posts:
- How can I remove the “Add New” button in my custom post type?
- Admin notice not displaying
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- manage_edit-{post_type}_sortable_columns sorts, but wrong!
- Creating a “glossary” of WordPress posts of a specific post type
- Sorting custom post types in edit.php : Post disappear
- How can I sort the order of multiple custom field values in a custom post type?
- Sort custom post column by generated value?
- Custom post type order by post_title
- Group/list/sort custom post type posts by date in tabs from acf datepicker field
- Custom order of CPT posts by title, in wp-admin area by default
- How to customize admin posts based on the user who is logged in
- Output custom post shortcode. Help spot the error.
- How to count custom post types with conditional operators
- WP_Query is printing out only one post when posts_per_page is set to multiple
- WP Query to displaying date and posts for that date?
- GravityForm: Populate Dropdown with custom post type [closed]
- Return array of categories to php function for current post
- Link users to a custom post type
- Create a random unique 6 digit number as custom field for custom post type
- How to output wordpress custom tags separated by comma?
- Get all of user’s custom post types in WP Admin for plugin
- Loading all files within a directory
- Blog page showing same content as homepage
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Change headers in admin posts list
- Using several custom fields as custom post title
- Custom Post Type without an archive page
- Get rewrite slug of custom post type in template
- Show Different Header on a Specific Post ID
- Get Post Primary Category
- Weird problem happening with custom taxonmy when creating/updating posts
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- Can’t get order_by meta_value_num to work properly
- Custom post type ‘orderby’ => ‘meta_value’ not working
- Custom Post Type + 20k posts = blank/404 within Admin edit.php [duplicate]
- Create custom post type on successful woocommerce order [closed]
- How to rank custom post type from score points
- Adding custom tables to WordPress
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- How do increase the amount of links shown down the left in the admin menu?
- submenu item edit a specific post
- Remove rows in the manage post/page view
- Sorting multiple custom post types without a meta key/value pair by sort order
- Very Slow Page – How to Optimize # of Queries?
- Dynamic page outside WordPress
- Using wordpress template tags within an array
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Order By Post Type ThenBy Taxonomy
- Getting the URL of the parent page
- Custom query to filter posts that have current post as a taxonomy [closed]
- Combining sorted and random CPT
- Custom post type permalink returns bad url
- Return the thumbnail meta data for getter and setter
- Admin not showing all custom post type posts and views not working
- How to avoid manage posts screen duplicates when two plugins use the same library
- How to display selected taxonomies by their parent
- Custom Field Order by Last Name and First Name
- Pagination for custom php code
- get_posts of Custom Post Type AND Custom Taxonomy
- Unable to retrieve any posts of CPT in wp-admin
- What’s the difference between same wp functions get_posts(); functions in different form?
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Display post meta on edit page in admin
- Custom Post Type Loop throws 500 error when used in widget
- how to check if custom post type column already exists?
- Get posts from a custom post type by child categories of a parent category
- Modify action buttons for custom post type
- Received nothing after executing AJAX post function
- How to make sure content doesn’t display if selection is empty
- Custom Post-Type not in admin menu
- get the custom post type title/name
- Sorting custom post type columns with external data and without meta values
- Page vs Custom Post Types Differences/Issues
- If post has custom field then display css-class
- Push metadata in array
- How to customize a permalink (URL) structure?
- Troubles with saving metabox
- CPT + CMB2: data not displaying for only first post in loop
- How to make a field appear only if a post meta field has a defined value?
- Replace text in post from cvs
- Get parent categories of custom post type
- Can I list a custom post type within another custom post type in the admin area?
- Admin Pointers on a custom post type
- Get custom post type list for every category shortcode
- Default sort on admin columns with meta date hides draft posts with empty date value
- How do i calculate the total of values of custom fields in custom post types?
- Categories sorting
- Wp_query: sort by PHP variable
- Crafting WP_Query array, sort by date
- Add a button or image button that calls wp functions in the wp-admin
- I would like to have different styles for my posts based on the content of each post
- Checking if Post Title is Unique as Loop Criteria
- Selecting a post in Dashboard
- Custom Post List View: Page or something else?
- Custom admin post.php page
- Query & Order posts by custom fields
- Custom Taxonomy back-end customizations
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- Custom post type – get_day_link()