Error establishing a database connection

Try logging into FTP and making sure there is no .maintenance file, also erase the upgrade folder. Its never a good idea to stop wordpress during an automatic update. Take a look at your wp-config file to make sure everything appears correct, it could of been editing it and you cut it off half way.

post custom values

Use var_dump($site[0]) to see the structure of the array. And once you know that, then you can properly reference an item in that array. (You could also do var_dump($site) to get a full picture of what’s going on.)

Force string into signup form

Not sure where you are placing the code as you don’t say – but you will need to edit the WordPress signup code / file and add your random string code in there and then hide the input for the sub-domain or set it to disabled and set it’s value to the random string. You’ll … Read more

Query posts alphabetically within this function

You’ll need to run through get_posts() to apply the order by handling. $planIDs = get_post_meta( $post->ID, ‘_lm_comm_plans’, false ); foreach( get_posts( array( ‘post__in’ => $planIDs, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘post_type’ => ‘plans’ ) ) as $plan ) { $pdfID = get_post_meta( $planID, ‘_lm_plan_pdf’, true ); $pdfURL = wp_get_attachment_url( $pdfID ); $planTitle = get_the_title( … Read more

Multi Quick Edit – Possible Or Impossible?

I’m not sure if there’s a WordPress-specific way to do this, but you can do a quick find-and-replace for the offending terms. I don’t know if it follows a pattern, but if you have access to the site through SSH you could do a MySQL dump and find/replace/reimport easily. Try this: mysqldump -uDBUSER -p DBNAME … Read more

URL conflict with a ‘Single Page Layout’

You can handle that with a hash (the way javascript does by default) and have the url become example.com#people, or any other delimiter really. It should be as simple as changing the character you’re parsing the url for. UPDATE: Example code as per comments $args = array( ‘label’ => ‘Your Label’, ‘labels’ => $labels, //define … Read more

Collect posts from last 48 hours

Never tested this ,but i believe you need to add WHERE clause to your query with time difference like so : $timediff .= ” AND post_date > ‘” . date(‘Y-m-d’, strtotime(‘-2 days’)) . “‘”; you can find it also in the codex http://codex.wordpress.org/Class_Reference/WP_Query#Time_Parameters If you do not want to use on query, but inside the … Read more