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!


Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. This 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

Post a Comment

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -