Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $args = array(
- 'posts_per_page' => 1,
- 'orderby' => 'rand',
- 'post_type' => 'product' );
- $random_products = get_posts( $args );
- foreach ( $random_products as $post ) : setup_postdata( $post ); ?>
- <li>
- <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
- </li>
- <?php endforeach;
- wp_reset_postdata();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement