I actually have a little problem while trying to use html inside a fuction code. It is something like this.
Expert Answered question
Try it
function misha_loadmore_ajax_handler() { $args = json_decode ( stripslashes ( $_POST[ 'query' ] ), true ); $args[ 'paged' ] = $_POST[ 'page' ] + 1; $args[ 'post_status' ] = 'publish'; query_posts ( $args ); if( have_posts () ) :while ( have_posts () ): the_post (); ?> <div class="griditem"> <a class="producturl" href="<?php the_permalink (); ?>"> <div class="productimagewrapper"> <img class="lazyload" data-src="<?php the_post_thumbnail_url (); ?>" /> </div> <div class="productinfo"> <h2 class="productname"><?php the_title (); ?></h2> <span class="productprice">$<?php echo esc_html ( get_post_meta ( get_the_ID (), 'price', true ) ); ?>.00</span> </div> </a> </div> <?php endwhile; endif; die; }
Expert Answered question