Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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')));
share|improve this question

1 Answer 1

up vote 5 down vote accepted

get_bloginfo( 'version' )

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

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

share|improve this answer
    
Thanks for the help scribu! –  Scott B Feb 14 '11 at 5:55
    
Found out a better way. See updated answer. –  scribu Feb 16 '11 at 9:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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