Count views without get_post_meta

If you provided full code, issue is probably in this line: $wpdb->prepare(“INSERT INTO ‘myprefix_posts_views’ (postid, ip, device) VALUES (%d, %s, %s) ON DUPLICATE KEY UPDATE create_at=VALUES(create_at)”, $postID, $_SERVER[‘REMOTE_ADDR’], $_SERVER[‘HTTP_USER_AGENT’]); Because into column postid you are trying to put variable $postID, when you didn’t declare it anywhere. This column is NOT NULL, so probably you have … Read more

Adding a Admin Style Table in a WordPress 4.x Page

We need to made few changes in the code so that it works properly. Here is the updated code. <?php if ( ! defined( ‘ABSPATH’ ) ) { exit; } if ( ! class_exists( ‘WP_List_Table’ ) ) { require_once ABSPATH . ‘wp-admin/includes/class-wp-list-table.php’; } class Transactions_List_Table extends WP_List_Table { public function __construct() { parent::__construct( array( ‘singular’ … Read more

How to create specific wordpress Table

There are probably a great number of ways to create such table. It is rather difficult to give an exact answer without knowing all the requirements and specifications. Here are some general level ideas that should get you started. First of all you’ll probably want to create a custom plugin to host all the relevant … Read more

Share or sync user table data with another user table

Welcome to WPSE. Asking for plugin recommendations is considered off-topic here, so here’s an action approach to the problem. wp_insert_user() takes care of adding new users to the database. The last action the function fires is user_register, which “Fires immediately after a new user is registered”. You could hook your function to this action and … Read more