Automatically delete inactive users after 2 months

Your query is wrong because your third argument to TIMESTAMPDIFF is incorrect. You should be using meta_value instead of SELECT meta_value. SELECT user_id FROM wp_usermeta WHERE meta_key = ‘wp_wp_kc_last_active_time’ AND TIMESTAMPDIFF( second, now(), TIMESTAMP(meta_value) ) > 5184000; Try that and see if the results start looking correct. I just checked over the mySQL Date Function … Read more

Anyone figured out how to use WordPress MultiSite with Domain Mapping & SSL?

I am using multisite with domain mapping. I chose the CNAME option for pointing the mapped domain name. My site is installed as a sub directory. http:// homesite.org/seedlivelihood Files are served like so: https:// homesite.org/seedlivelihood/wp-content/plugins/woocommerce/assets/css/fancybox.min.css?ver=3.2.1 With domain mapping the site is at: seedlivelihood.org Which is where my SSL is set up to be from. Safari … Read more

Linking Two Post Types

Scribu’s posts-to-posts is a great and simple plugin, I’m sure we can help you get it working. The basic usage is pretty straightforward. assuming your custom post types are named ‘place’ and ‘event’, the following code would go into your theme’s functions.php file: function my_connection_types() { p2p_register_connection_type( array( ‘name’ => ‘events_to_places’, ‘from’ => ‘event’, ‘to’ … Read more

Add button to TinyMCE bar without creating a plugin

It is almost code golf, but this is the smallest piece of code that I could up with that will create a button on the Visual editor to turn the current paragraph in a <h2> block. add_filter( ‘tiny_mce_before_init’, ‘wpse18719_tiny_mce_before_init’ ); function wpse18719_tiny_mce_before_init( $initArray ) { $initArray[‘setup’] = <<<JS [function(ed) { ed.addButton(‘h2’, { title : ‘H2’, … Read more

Custom maintenance page

When WordPress goes into maintenance mode, it adds a file named .maintenance to the root directory while the maintenance is being performed, then it’s removed afterwards. You can write a function inside your theme’s functions.php that checks for this file and loads a custom maintenance page from the theme. if ( ! function_exists( ‘wpse84987_maintenance_mode’ ) … Read more

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