php - Beginner: How to add permalink to WP_Query multiple custom post types? -
i'm making simple page displays multiple post types. how add permalinks values returned the_post_thumbnail
& the_content
?
<?php $custom_query = new wp_query( array( 'post_type' => array('downloads', 'bjd', 'prints'), ) ); if ( $custom_query->have_posts() ) : while ( $custom_query->have_posts() ) : $custom_query->the_post(); the_post_thumbnail('productgal-thumb'); <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> the_content(); endwhile; endif; wp_reset_query(); ?>
also, if try place these functions in simple <div>
elements format style breaks code well.
simply use this
<?php $custom_query = new wp_query( array( 'post_type' => array('downloads', 'bjd', 'prints'), ) ); if ( $custom_query->have_posts() ) : while ( $custom_query->have_posts() ) : $custom_query->the_post(); ?> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('productgal-thumb'); ?> </a> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> <a href="<?php the_permalink(); ?>"><?php the_content(); ?> </a> <?php endwhile; endif; wp_reset_query(); ?>
Comments
Post a Comment