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 created a custom plugin that activates a custom contact form widget, and when I add it to my sidebar, it appears outside of the sidebar container.

Here's the code for calling the sidebar:

<div class="sidebar">
    <?php get_sidebar(); ?>
</div>

Here's the visual part of the widget: (It's not done yet)

  function widget($args, $instance)
  {
    extract($args, EXTR_SKIP);

    echo $before_widget;
    $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);

    if (!empty($title))
      echo $before_title . $title . $after_title;;

    // WIDGET CODE GOES HERE
?>
    <form>
        <lable>First Name</lable>
        <input type="text" id="firstname" />
    </form>
<?php

    echo $after_widget;
  }

How it appears:

<div class="sidebar">
    //search form code here
</div>
<div class="contact....>
     //contact form code here
</div>

What could possibly cause it to behave like that?

P.S: If anything else is needed, let me know.

share|improve this question
1  
Browsers sometimes show something like this in DevTools, when there are errors in HTML. Are you showing output of DevTools or View source method? –  Krzysiek Dróżdż Jul 2 '13 at 11:48
    
Yea, I use Chrome. I double checked my HTML, though... –  xTCx Jul 2 '13 at 11:51
    
Nevermind! Found the mistake! I edited the search form in my functions.php file, and apparently I left out a closing <div> tag, which resulted in this behavior. Sorry and thanks! –  xTCx Jul 2 '13 at 11:54
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.