Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7607583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:42:03+00:00 2026-05-31T00:42:03+00:00

I am facing issue in debug mode with wordpress. In my featured slider getting

  • 0

I am facing issue in debug mode with wordpress. In my featured slider getting error
Notice: Object of class WP_Query could not be converted to int in on line

I am using below code for my slider

<div id="<?php slider_class() //Theme function ?>" class="clearfix">

    <!--[BEGIN: Slider wrapper]-->
    <div id="slides-wrapper" <?php slider_wrapper_class() //Theme function ?>>
        <!--[BEGIN: #Slides]-->
        <div id="slides" class="<?php slides_class() //Theme function ?> clearfix">
            <!--[BEGIN: Slides_container]-->
            <div class="slides_container <?php slides_class() //Theme function ?>">

                <?php
                $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++) { // second for() loop for post slides
                while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); // loop for posts
                ?>

                <?php if (get_option('mp_slides_content') === "content_s") { ?>
                <!--[BEGIN: ALL SLIDES ++]-->
                <div class="slide clearfix">
                    <!-- thumbnail start -->
                    <?php mp_thumb('featured-thumbnail','featured-slider-thumbnail','480'); //Theme function  ?>
                    <!-- end of thumbnail -->

                    <div class="featured-excerpt">
                        <h2 class="title"><a href="<?php the_permalink(); ?>"><?php echo substr($post->post_title,0,50); // short title ?>...</a></h2>

                        <?php the_excerpt(); ?>
                        <br />
                        <a href="<?php the_permalink(); ?>" class="featured-readmore clearfix"><span>Read more</span><img src="<?php bloginfo('template_directory'); ?>/images/button-arrow.png" alt="readmore" width="24" height="24" /></a>
                    </div>

                </div>
                <!--[END: ALL SLIDES ++]-->

                <?php } elseif (get_option('mp_slides_content') === "image_s") { ?>

                <!--[image slider start]-->

                <!--[BEGIN: ALL SLIDES ++]-->
                <div class="slide clearfix">
                    <!-- thumbnail start -->
                    <?php if (get_option('mp_slides_style') === "fixed") { ?>

                        <?php mp_thumb('featured-thumbnail','featured-slider-image920','920'); //Theme function  ?>

                    <?php } else { ?>

                        <?php mp_thumb('featured-thumbnail','featured-slider-image960','960'); //Theme function  ?>

                    <?php } ?>
                    <!-- end of thumbnail -->

                </div>
                <!--[END: ALL SLIDES ++]-->             

                <!--[end of image slider]-->

                <?php } ?>

                <?php endwhile;
                } // end for() loop number 2
                ?>

            </div>
            <!--[END: Slides_container]-->

            <a href="#" class="prev"></a>
            <a href="#" class="next"></a>

        </div>
        <!--[END: #Slides]-->

    </div>
    <!--[END: Slider wrapper]-->

</div>

//theme function are nothing but switching the class for style

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:42:04+00:00Added an answer on May 31, 2026 at 12:42 am

    You should remove the for loop, don’t think $featuredPosts is a valid int field, which is probably what it’s complaining about.. also this would loop through the posts many times which you’re already doing with while have_posts()

     <?php
                    $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++) { // second for() loop for post slides
                    while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); // loop for posts
                    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing issue with the following Json reponse object in the javascript eval
Im facing an issue which I believe to be VAO-dependant, but Im not sure..
I am trying to debug an issue one of my testers is facing. The
I am facing some issue i beleive you could help me. The Scenario is
I am facing an issue in getting the correct frame for two different strings.
I am facing issue while drawing semitransparent object with RenderToSurface(While it working file when
I am facing strange issue on Windows CE: Running 3 EXEs 1)First exe doing
I am new to MVC and facing one issue. I have a xml file
I am using Appweb server (mini http server) and facing an issue while opening
I'm working on a project which uses user authentication. I'm facing a issue with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.