Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)

This is a really interesting question, which can result in a very expensive, resource intensive process which can really slow your page down dramatically PRELUDE All my code in this question is based on the following post type and taxonomy, so before you run any code, make sure to adjust the post type and taxonomy … Read more

Moving an entire wordpress site from one domain to a new domain and database

First add define(‘WP_SITEURL’, ‘http://example.com’); define(‘WP_HOME’, ‘http://example.com’); To your wp-config.php file (obviously change example.com to your domain) then login and once you see the admin panel navigate to http://yoursite/wp-admin/options.php there you can change home and siteurl to your new domain and save. You will also need to change the links for images and other media in … Read more

How do I add indexes to WordPress Database?

The WordPress database is already indexed. See this codex article for a detailed list of indexes per table: http://codex.wordpress.org/Database_Description And even if it weren’t, you’d need to know what queries are being run in order to effectively add indexes. Meaning, there would be no quick fix–you’d have to learn how indexing works, figure out what … Read more

Querying Email Addresses for a List of Users with Same Last Name?

Hi @Holidaymaine: Here’s the query you are looking for: <?php include( ‘../wp-load.php’ ); $sql =<<<SQL SELECT DISTINCT u.user_email AS user_email, um.meta_value AS user_lastname FROM {$wpdb->users} AS u LEFT JOIN {$wpdb->usermeta} AS um ON u.ID = um.user_id LEFT JOIN {$wpdb->posts} AS p ON u.ID = p.post_author LEFT JOIN {$wpdb->term_relationships} AS tr ON p.ID = tr.object_id LEFT … Read more

How do I move a WordPress site to another server?

I do this all the time to move a site from our staging server to the live domain. I use PHPMyAdmin to export the database as an SQL file, then open it up in a text editor and do a global find and replace on the old url to change it to the new url. … Read more

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