WordPress: Fix Inove Theme footer for WP 3.5+
If you see an error at the bottom of your blog pages like:
Warning: Missing argument 2 for wpdb::prepare(), called in /.../wp-content/themes/inove/footer.php on line 22 and defined in /.../wp-includes/wp-db.php on line 990 |
The problem is that the prepare function was recently changed to require at least two parameters.
As my Inove theme doesn’t seem to be supported, I dove it to fix it myself.
I quickly found a simple fix online. N.B. depending on the application, there may be security ramifications; the changeset linked above mentioned that authors may have been incorrectly using prepare to sanitize queries.
That having been said, to eliminate the error, just change /…/wp-content/themes/inove/footer.php: line 22 from:
$post_datetimes = $wpdb->get_row($wpdb->prepare("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970")); |
to:
$post_datetimes = $wpdb->get_row("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970"); |
That is, remove the call to prepare.
Hope that helps!
Recent Comments