title: Permalink not working as expected in wordpress category dropdown ajax
body: <p>Here's my php code:</p>
  
  <pre><code>define('WP_USE_THEMES', false);
  require_once('../../../wp-load.php');
  $post_type = $_GET['posts_type'];
  $name = $_GET['name'];
  $pageNum = $_GET['num_page'];
  switch($post_type){
      case "category":
          getCategoryPosts($pageNum, $name);
          break;
  }
  
  function getCategoryPosts($p, $n){
      query_posts('posts_per_page=5&amp;paged='.$p.'&amp;cat='.$n);
      if(have_posts()){
          echo "&lt;ul class='category-dropdown-posts'&gt;";
              while(have_posts()){
                  the_post();
                  $permalink = get_the_permalink();
                  echo "&lt;li&gt;&lt;a href=".$permalink."&gt;";
                  echo get_the_post_thumbnail($post-&gt;ID, array(172, 132), array('class'=&gt;'dropdown-pic'));
                  echo "&lt;p class='dropdown-title'&gt;".get_the_title();
                  echo "&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;";
              }
          echo "&lt;/ul&gt;";
      }
      wp_reset_query();
  }
  </code></pre>
  
  <p>Now everything is working fine, except the permalink. As you can see that the a tag should be wrapped around both img and p tags, but what I get is something like this:</p>
  
  <pre><code>&lt;li&gt;
  &lt;a href="..."&gt;&lt;/a&gt;
  &lt;img ..../&gt;
  &lt;p&gt;...&lt;/p&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>Any idea what could be wrong?</p>
  
  <p>Edit: The console.log of ajax response seems to be correct, but the display is messed. I am using Firefox in Ubuntu in Virtual Machine.
  Edit 2:
  Here's the ajax response:</p>
  
  <pre><code>&lt;ul class='category-dropdown-posts'&gt;&lt;li&gt;&lt;a style='display:block' href=http://localhost/wordpress/post-to-post/&gt;&lt;img width="172" height="114" src="http://localhost/wordpress/wp-content/uploads/2014/12/post-to-post-300x199.jpg" class="dropdown-pic wp-post-image" alt="Post To Post" /&gt;&lt;span class='dropdown-title'&gt;Post to Post&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
  </code></pre>
  
  <p>I have figured out the problem. As you can see the href in a is not quoted, which is causing the behaviour. Thanks for the help guys.</p>