Using class id from array for query

Try this after your $wpdb query: // collect calendar id’s $ids = array(); foreach( $calendar_entries as $calendar_entries): array_push( $ids, $calendar_entries->id ); endforeach; // query the above calendar id’s $args = array( ‘post_type’ => ‘post’, ‘post__in’ => $ids, ‘orderby’ => ‘id’, ‘order’ => ‘DESC’ ); $query = new WP_Query( $args ); You can also modify the … Read more

Changing database links has no effect

I can’t tell exactly what you are asking but this comment… What I did recently is that I created a wordpress dir on FTP server and move stuff there, but now people would have to input mydomain.com/wordpress to access my webpage… … makes me wonder it you don’t have a subdirectory install. If that is … Read more

Query sql for truncate post_content in wp_posts table

Backup your db Remeber to backup your db Import the backup in another database, change wp-config.php to use this new database and see if everithing is ok. (Importing is successfull? Site appear without any change?) WordPress uses a prefix for table names. The default is ‘wp_’ but clever guys change it with something else. (The … Read more

Working local with one database

Set up a staging database on an online host and connect remotely from your various local dev environments. Might get a little confusing sharing 1 DB between many installs though.

Share WordPress Database

Does the WordPress installation has to use an exclusive database? If there are no table name conflicts, WordPress can share a database. Preventing conflicts is just a matter of setting a database prefix on install. By default, that prefix is wp_ but you can change it to anything you want within reasonable character limits. It … Read more