Broken wordpress site, non-working links and no access to wp-admin page

https://wordpress.stackexchange.com/ is the stackexchange website that deals with wordpress. It seems like your website is hosted by Automattic so you can get their help by communicating with their support staff. Go to https://wordpress.com/support/contact/ and click on “I need customer service for a paid site hosted at wordpress.com“ https://wordpress.com/support/com-vs-org/ WordPress is a free and open-source Content … Read more

how to get Nearby zipcode

Most likely your values $latitude and/or $longitude are not what you expect them to be. So radians($latitdue) becomes radians() or radians(”). For getting a single row, get_row() is usually the better choice instead of get_results(). $zipdetail = $wpdb->get_row( “SELECT * FROM `li_zipcode` WHERE `zip_code` = ‘$zipcode'”, OBJECT ); If $zipcode is coming from an untrusted … Read more

WordPress Custom SQL Table with UserID Filter for results

The evolution of this question makes it difficult to succinctly answer, but in brief summary: Using $wpdb->prepare() to construct arbitrary SQL queries to execute against the database helps to mitigate injection vulnerabilities by escaping inserted variables. To use it, instead of concatenating or directly inserting variables into the query, use a placeholder for the appropriate … Read more

Placing a widget with $wpdb query

Placing widgets via a MySQL or something MySQL abstracted via the global variable $wpdb that is an instance of the WPDB class is not trivial. That’s not because MySQL is something complicated or because $wpdb is useless at all but this has do something with the way the widget configuration is stored inside the mysql … Read more

Copying post thumbnail to custom field

I wouldn’t bother doing that. I’d just find the places in your theme files that call the custom field (probably something like “echo get_post_meta(‘bigimage’)” or something) and replace those with a the_post_thumbnail() tag. This saves you the trouble of messing with the data, and it makes administration much, much simpler going forward–which is kind of … Read more

database optimization and server errors

It probably is a host issue. Assuming that you’re relatively stock WordPress, the queries shouldn’t be so inefficient that they’re causing timeouts. When it says a “remote mysql database”, does that mean a remote database server with the same hosting company, or does it mean you’re using a database server that’s physically located somewhere else? … Read more