This topic is: not resolved
- This topic has 0 replies, 1 voice, and was last updated 7 years ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- The forum ‘General Discussion’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
Community Forums › Forums › Archived Forums › General Discussion › Outreach Pro: Insert Widget Areas Between Post Excerpts
Tagged: ad placements, category archives, Outreach Pro, widgets
Hello everyone.
I'm working with Outreach Pro and trying to insert widget areas at specific intervals on category pages in order to place ads in them with the Advanced Ads plugin.
The category pages in question have 25 post excerpts on them, and I'm trying to create widget areas after post excerpts 2/7/12/17.
Below is the code I'm working with that's not working. Of all things, I'm getting a "syntax error, unexpected 'echo' (T_ECHO)".
I'm still a bit of a novice with PHP, and any help would be much appreciated.
//* Ads between WordPress Post Excerpts
add_action( ‘genesis_after_entry’, ‘between_post_ads’ );
function between_post_ads() {
global $loop_counter;
$loop_counter++;
if( (is_category() && ($loop_counter == 2 || $loop_counter == 7 || $loop_counter == 12 || $loop_counter == 17)) {
echo '<div class="ads">';
dynamic_sidebar( ‘ads’ );
echo '</div>';
}
}
}
//* Register Ads widget
genesis_register_sidebar( array(
‘id’ => ‘ads’,
‘name’ => __( ‘Ads Between Posts’, ‘post_ads’ ),
‘description’ => __( ‘This is the Ads section between posts.’, ‘post_ads’ ),
) );
© 2026 WPEngine, Inc.