Shortcode Coding not working
-
Can you help me figure out what’s wrong with this coding????
// Add Shortcode function book_display_shortcode( $atts ) { extract( shortcode_atts( array( 'author' => 'default', 'type' => 'products', ), $atts ) ); $args = array ( 'post_type' => $type, 'tag_name' => $author, ); $book_query = new WP_Query( $args ); ob_start(); ?> <div class="books-display"> <?php if ( $book_query->have_posts() ) { while ( $book_query->have_posts() ) { $book_query->the_post(); <a> " > <?phpget_the_post_thumbnail($post_id, 'thumbnail'); ?> </a> } } else { // no posts found } wp_reset_postdata(); ?> </div> <?php return_ob_get_clean(); } add_shortcode( 'books', 'book_display_shortcode' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Shortcode Coding not working’ is closed to new replies.