php - Ads between posts in Wordpress with Genesis Framework -
i trying set blog inserts ad between each post. here's wire frame explain trying do. (wireframe) ads outlined in red. using genesis framework.
i tried using custom post types create "ad" post type problem can't prevent ads duplicating on same page. use
here's loop using. run genesis_after_entry hook add loop.
<?php $args = array( 'post_type' => 'ads', 'posts_per_page' => 1, 'orderby' => 'rand' ); $do_not_duplicate = array(); $loop = new wp_query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); $do_not_duplicate[] = $post->id; the_content(); endwhile; ?>
something's wrong because it's still duplicating. appreciated!
This comment has been removed by the author.
ReplyDeleteThis is such nice and useful information for us. I really appreciate this blog to have this kind of knowledge. Also explore Genesis Wordpress Theme Development Services
ReplyDelete