Set page template for all pages?

EDIT As noted in the comments on your question, the best approach would just be to edit your page.php file. If you want ALL of your pages to have the same page template, and not have to do anything extra to set it that way, it’s quite obvious why this is a good idea. 🙂 … Read more

Where can I find the database changes between WordPress versions?

In wp-admin/includes/upgrade.php are version specific functions for database upgrades. They include changes for the schema. Examples for 3.4.0 and 3.5.0: /** * Execute changes made in WordPress 3.4. * * @since 3.4.0 */ function upgrade_340() { global $wp_current_db_version, $wpdb; if ( $wp_current_db_version < 19798 ) { $wpdb->hide_errors(); $wpdb->query( “ALTER TABLE $wpdb->options DROP COLUMN blog_id” ); … Read more

Restoring WordPress posts from database only

Re-install a new copy of wordpress and then put in the credentials to your database in the new install. If you install wordpress and try to load the domain with no database attached, it will start the site creation wizard. Just enter the correct database credentials (username, database name, password, and location) and it will … Read more

SQL query to extract only the “current” wp_posts?

Rather than constructing query from scratch, it is easier to see what exactly is WordPress querying when API function is used: get_posts(array( ‘numberposts’ => -1, )); var_dump( $wpdb->last_query ); Gives following SQL: SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type=”post” AND (wp_posts.post_status=”publish”) ORDER BY wp_posts.post_date DESC

Custom form that store input in database

I got the problem solution myself. See the code below this will do that. Put the code inside your newly created custom template. <?php if (!empty($_POST)) { global $wpdb; $table = wp_achord; $data = array( ‘name’ => $_POST[‘yourname’], ‘chord’ => $_POST[‘chord’] ); $format = array( ‘%s’, ‘%s’ ); $success=$wpdb->insert( $table, $data, $format ); if($success){ echo … Read more

Reset Post IDs to less than 64bit integer

This answer is the way I would take to solve the issue if I had to face it, it means is not the answer but one of the possibilities. All the operations I will suggest should be run on a development/local server on a backup of database and not on production nor on original database. … Read more