0

I'm unable to devine what's causing my theme to crash in WP 2.9.2, although I know its something in my query statement below, so I need to do a version check for (version) < 3 to branch it.

What is the method to get the currently installed WP version? - I'm just using "wp_version" as a stand in :)

if(wp_version < 3)
    $myqueryTopMenu = '';
else
    $myqueryTopMenu = new WP_Query();$myqueryTopMenu->query(array('cat' => "$cat,-$catHidden",'post_not_in' => get_option('sticky_posts')));

1 Answer 1

6

get_bloginfo( 'version' )

Other version globals can be found in wp-includes/version.php

Also, it's safer to use PHP's version_compare().

1
  • Found out a better way. See updated answer.
    – scribu
    Commented Feb 16, 2011 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.