I tried a PHP code in a Text widget now all sidebar widgets are gone!

  • Unknown's avatar

    ok so I was trying to add the following code in a text widget:

      <?php
      $result = $wpdb->get_results(“SELECT comment_count,ID,post_title, post_date FROM $wpdb->posts WHERE post_date BETWEEN ‘2009-06-01’ AND ‘2009-07-01’ ORDER BY comment_count DESC LIMIT 0 , 10”);

      foreach ($result as $topten) {
      $postid = $topten->ID;
      $title = $topten->post_title;
      $commentcount = $topten->comment_count;
      if ($commentcount != 0) {
      ?>

    • “><?php echo $title ?>
    • <?php }
      }
      ?>

    afterwards all my widgets disappeared along with my footer.

    I can see the widgets in my Admin Control Panel just fine but they are not showing on the site. I tried removing/adding them again but no good.

    any ideas?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    The blog you specified at http://www.kumailplus.com does not appear to be hosted at WordPress.com.

    This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.

    If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.

    If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.

    This is an automated message.

  • Unknown's avatar

    You are posting to the wrong forum. Please go to the forum the support bot points to > http://wordpress.ORG/support/

  • The topic ‘I tried a PHP code in a Text widget now all sidebar widgets are gone!’ is closed to new replies.