POSTS list in WordPress by views

Seems like you already have the custom field for views set up since that’s a phpMyAdmin screenshot. If so, you can use order_by=”post_views_count” in most wp_query based calls. For instance: $args = array( ‘post_type’ => ‘your_post_type’, ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘post_views_count’, ); $query = new WP_Query( $args ); //…and on with the loop <?php … Read more

Moving database with phpMyAdmin

I would do this so. But this is probably not the most efficient way accomplishing this task. There are several plugins out there, that may automate this. If anyone knows one, that is good, I would like to hear about it. Plugins that look promising: http://wordpress.org/extend/plugins/xcloner-backup-and-restore/ http://wordpress.org/extend/plugins/duplicator/ http://wordpress.org/extend/plugins/wp-migrate-db/ Find more at: http://wordpress.org/extend/plugins/tags/backup

Where is the “default attribute” values located in the phpMyAdmin in Woocommerce?

Default attributes of WooCommerce variable products are stored as post meta in the database. You can find them in the wp_postmeta table, where the post_id column is the post ID of the parent product (Variable product), and the meta_key column is _default_attributes. You can clear and remove default attributes of all products by replacing all … Read more

Manually delete post from database

Drop this into a file in your plugin directory and you should be able to do this from your WP installation using a query string. /* Plugin Name: Delete Specific Post Description: Rid the post forever! Version: 0.1 Author: WPSE License: GPL2 */ add_filter(‘query_vars’, ‘delete_post_query_var’); function delete_post_query_var($vars){ $vars[] = ‘delete_post’; return $vars; } add_action(‘admin_init’, ‘manually_delete_post’, … Read more

“#1067 – Invalid default value for ‘post_date'” when trying to reset AI after backup

The post_date default value is 0000-00-00 00:00:00. If you check the sql_mode variable like this: show variables like ‘sql_mode’; … it will show you the sql_mode variable, that will be sth like this: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION You have to set up again sql_mode variable without NO_ZERO_IN_DATE,NO_ZERO_DATE So in the previous example you should set the sql_mode like … Read more

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