Your problem is here:
$featuredPosts = new WP_Query();
$featuredPosts->query('showposts=".get_option("mp_slides_no').'&category_name=".get_option("mp_featured_cat').'');
for($i=1; $i<=$featuredPosts; $i++) {
You’re creating a new instance of WP_Query to run a custom query and storing it in the $featuredPosts variable. But then you’re trying to use $featuredPosts as the upper limit of a for loop. This is what PHP is complaining about. Your $i<=$featuredPosts should be something more like $i<=count($featuredPosts->posts).
That said, you’re using actual Loop functions below that … which belong in a while($featuredPosts->have_posts()) loop instead of a regular for loop …
Related Posts:
- What is the best way to monitor PHP functions/executions?
- How do I set up Debugging?
- add_sub_menu page() to be replaced by add_theme_page()
- Get PHP Fatal error on globalized $wpdb: Call to a member function insert() on a non-object- I have no clue. What to do?
- How to show the error causing the ‘There has been a critical error on your website’?
- How do you change error reporting to only show errors in WordPress?
- How to Debug WordPress
- Error message prevents access to WP
- Getting notices on fresh 3.6.1 install
- Front end empty (i.e. nothing displays); Back end looks fine; What are possible causes?
- WordPress + Buddpyress – troubleshooting server overloading
- Unnessary character on post after restore
- How to find which plugin crashes
- write developer debug statements to separate log
- I’m getting this ‘PHP Deprecated’ issue
- Platform sh site setup in localhost gets Cookie error
- Error logging in wordpress
- Critical Error on Pages – WP_DEBUG Not Showing Anything
- How to disable the fatal error (WSOD) protection?
- error_log() output for print_r() appearing on page
- How to eliminate weird 404 errors in wp-admin?
- Could not create directory /wp-content/upgrade/
- Getting the warning: Missing argument 2 for manage_posts_custom_column()?
- What log files does a WordPress installation write to?
- How to use WP_Error $data argument?
- Is it possible to disable caching of an option when using w3 total cache?
- Error 310 too many redirects after switching domains
- Error Logs to Diagnose Error 500 in LAMP
- “Notice: Undefined index:” error when adding new content?
- Recommend a guide to catching plugin errors, please?
- How to handle core code throwing notice on valid input?
- Trying to get property of non-object in wp-includes/capabilities.php
- WordPress home page doesn’t work, but other pages do. How to rectify?
- File available but giving 404 in wordpress
- Only on 404 page, get notice: trying to get property of non-object on nonce
- In big trouble – Allowed memory size of 268435456 bytes exhausted
- PHP Warning : A non-numeric value encountered
- Wordpres debug.log PHP Notice: is_singular was called
- Warning: Declaration of QuietSkin::feedback error
- failed to open stream: No such file or directory
- Getting 403 Access Denied Error Message in new WordPress Post
- update user information
- My wordpress site loads perfectly, but I cannot access the menus in the admin panel
- Call to undefined function wp_embed_register_handler()
- Site works fine, but editing page causes error “Call to undefined function _wp_array_get()” in Gutenberg
- Error! 401.shtml file not found, what’s the problem?
- Error wordpress “Call to undefined function aq_resize()” [closed]
- Strange glyphs code error
- Custom slider throwing an error
- err_connection_closed after 20 minutes when loggedin in backend
- How to Fix “Are You Sure You Want to Do This”, while uploading my theme?
- 4.2.2 stuck in an db upgrade loop with “Call to undefined method wpdb::get_col_length()”
- Cannot redeclare maybe_create_table()
- Debugging unserialize errors [closed]
- Fatal error: Allowed memory size of 146800640 bytes exhausted (tried to allocate 57 bytes) in public_html/wp-includes/rewrite.php on line 1561
- Display all WP Errors together during form validation
- “Cannot modify header information” means I can’t use wp_redirect
- How can I use wordpress functionality outside of WP framework
- Errors in Add Image Popup, Media Library Tab: “in_array() expects parameter 2 to be array, null given in wp-includes/query.php”
- hypanis.ru wordpress vulnerabilty [closed]
- WordPress debug messages not displaying
- Child Theme Fatal Error [closed]
- Jetpack could not contact wordpress [closed]
- Internet Explorer cannot display the webpage
- my blog crashes ie7?
- Internal Server Error only on frontend and certain admin pages
- How to automatically convert “%” and “+” in image urls on upload
- Failed to import “File name”: Invalid post type jetpack-portfolio
- Error call_user_func_array() After Installing Plugin
- Error 500 when installing WordPress
- Warning: call_user_func_array()
- “File not found.” appears often while navigating wp-admin
- WordPress Error blank page In section website
- Posts, pages and some images are deleted sometimes
- Call to undefined function wordpress listing_categories
- how do i fix these errors my debug log gave me?
- Fatal error: Call to undefined function wp_add_privacy_policy_content() in /wp-admin/includes/misc.php on line 1822
- SyntaxError: unterminated string literal – if WordPress Debug in wp-config is set to true
- Unable to customize themes in wordpress after migrating to https from http
- A SINGLE Post Giving an “Under Maintenance” Message
- Weird Cron Error
- Error messages generated in ‘Customize Your Site’
- Overcome illegal characters [duplicate]
- bypassing permission error for a plugin’s page
- Website Loading Very Slow, Each Time Different File Takes Very Long To Load
- Fatal error: Allowed memory size of bytes exhausted (tried to allocate 36 bytes)
- Any idea on how to fix this error when forcing SSL on a certain page?
- warnings & errors after MAMP to live (hosteurope)
- Random HTTP 500 error in WordPress
- Add clickable function in functions.php – parse error [closed]
- Trying to add function with pre_get_posts for plugin search [closed]
- undefined index [closed]
- WordPress is not sending the 2nd email in the same request
- Core error when calling remove_menu_page
- WordPress returns empty page
- Fatal error on random blog posts
- How to hook into debug.log?
- Should a theme have it’s own tinymce address?
- Importing content but it displays that it already exists
- Can’t access my site, getting ‘There has been a critical error on this website. Please check your site admin email inbox for instructions.’ message