title: Prepending a dynamic 'a' tag to the 'li' elements with a certain class
body: <p>Please take a look at the code below:</p>
  
  <pre><code>&lt;ul id="all-movies"&gt;                    
    &lt;li class="movie"&gt;
      &lt;img src="pic.jpg" /&gt;
    &lt;/li&gt;
    &lt;li class="movie featured"&gt;
      &lt;img src="pic.jpg" /&gt;
    &lt;/li&gt;
    &lt;li class="movie featured"&gt;
      &lt;img src="pic.jpg" /&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>In the code above, I would like to prepend <code>&lt;a href="&lt;?php bloginfo('url'); ?&gt;/hello"&gt;&lt;/a&gt;</code> to the <code>li</code> elements with a class of <code>featured</code> so that it looks like this:</p>
  
  <pre><code>&lt;ul id="all-movies"&gt;                    
    &lt;li class="movie"&gt;
      &lt;img src="pic.jpg" /&gt;
    &lt;/li&gt;
    &lt;li class="movie featured"&gt;
      &lt;a href="&lt;?php bloginfo('url'); ?&gt;/hello"&gt;&lt;/a&gt;
      &lt;img src="pic.jpg" /&gt;
    &lt;/li&gt;
    &lt;li class="movie featured"&gt;
      &lt;a href="&lt;?php bloginfo('url'); ?&gt;/hello"&gt;&lt;/a&gt;
      &lt;img src="pic.jpg" /&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>And <code>&lt;?php bloginfo('url'); ?&gt;</code> will be replaced with my site.</p>
  
  <p>How can I get this to work? I have tried something like the following but it didn't work:</p>
  
  <p><code>$("#all-movies li").hasClass('featured').prepend('&lt;a href="&lt;?php bloginfo('url'); ?&gt;/hello"&gt;&lt;/a&gt;');</code></p>
  
  <p>Note: The <code>featured</code> class is being added dynamically.</p>
  
  <p>-edit- This is the code I'm using to add the <code>featured</code> class dynamically:</p>
  
  <pre><code>function wpse80098_filter_post_class( $classes ) {
      global $post;
      if ( 'yes' == get_post_meta( $post-&gt;ID, '_jsFeaturedPost', true ) ) {
          $classes[] = 'featured';
      }
      return $classes;
  }
  add_filter( 'post_class', 'wpse80098_filter_post_class' );
  </code></pre>