简体   繁体   中英

WP_query call triggers a fatal error

The fourth line below is creating an "Apache HTTP Server Stopped Working" error in my app. Anyone see anything that stands out?

$cat=get_cat_ID('top-menu');
$catHidden=get_cat_ID('hidden');
$myqueryCurrent = new WP_Query();
$myqueryCurrent->query(array('cat' => "$cat,-$catHidden",'post__not_in' => get_option('sticky_posts')));

This is running under WordPress 2.9.2 The same code in 3.0 runs fine. PHP is version 5.3.1

Scott,

Again, we need to go deeper. It would be helpful to have the actual mysql query that is being generated by the WP_Query object.

Can you put more debugging output into the WP_Query class, in the ->query method.

Furthermore, can you verify that get_option('sticky_posts') returns a comma separated list?

To ease out the debugging - enable debugging mode in wp-config.php in your WordPress root folder - i know i had problems with apache doing silly stuff if i had any error.

When enabled, please verify (as mentioned above) that everything you try to use in your query actually returns stuff

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM