Archive

Archive for the ‘WordPress’ Category

WordPress: Fix Inove Theme footer for WP 3.5+

February 1st, 2013 No comments

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!

Categories: WordPress Tags:

Formatting code blocks in a WordPress blog

May 12th, 2010 No comments

I haven’t found a way I really love to present code in a fixed width WP layout, but the one I use is workable. It produces code that looks like this:

It uses a <code> inside a <pre> with a scrolling option to:

  • preserve indentation
  • use a special font in a quote box to differentiate from other text
  • provide a scroll bar, as code invariably goes past the fixed width

Here is the code (ironically described inside itself):

<pre style="overflow-x: scroll; padding: 10px;"><code>[Your code here]</code></pre>
Categories: WordPress Tags: , ,

Fixing URLs after moving a WordPress blog

May 10th, 2010 3 comments

When I moved my WordPress blog, all my image links were broken :(  Fortunately, with a simple google search (mysql replace substring), and 5 minutes of work in phpMyAdmin, everything was right as rain.

I ran the command (adapted from a comment here) on two fields in the wp_posts table - wp_content and guid:

UPDATE wp_posts
SET [insert_field_name_here] =(
REPLACE ([insert_field_name_here],
'[insert_old_URL_here]',
'[insert_new_URL_here]'));

One browser refresh later, I was returned to multimedia heaven :)

Categories: WordPress Tags:

windows 7 product key

windows 7 product key

windows 7 key generator

windows 7 key generator

free winrar download

free winrar download

winzip activation code

winzip activation code

free winrar

free winrar

winzip free download

winzip free download

winrar free download

winrar free download

winrar download free

winrar download free

winzip free download full version

winzip free download full version

windows 7 activation crack

windows7 activation crack

windows 7 crack

windows 7 crack

free winzip

free winzip
\n