• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Outreach Pro: Insert Widget Areas Between Post Excerpts

Welcome!

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.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Outreach Pro: Insert Widget Areas Between Post Excerpts

This topic is: not resolved

Tagged: ad placements, category archives, Outreach Pro, widgets

  • This topic has 0 replies, 1 voice, and was last updated 5 years, 9 months ago by hiwattage.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • August 29, 2019 at 8:56 pm #493297
    hiwattage
    Participant

    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’ ),
    ) );
  • Author
    Posts
Viewing 1 post (of 1 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble