Site logo

Archived topic

Create new widget area between blog post of the home page.

5 replies · Started by Victor Millan on February 19, 2019

Viewing posts 1–6 of 6

Hello, first of all, I want to congratulate you for your work and thank you very much for your time.

Now my query. On a blogroll type homepage, I would like to add two areas of widgets in between the posts. For example, after 3 post, one widget area, and after 7, another. Is it possible to relocate some footer widget that is not used for this? Or include them in some way?

Mi site is based on Marketer theme.

Thank you

Victor

Hey Victor,

Doing something like this would be quite complex, unfortunately. It would involve re-writing the post loop in custom templates. It's a little too involved to explain via forums.

I'm not sure what you're adding, but have you looked into a plugin like Ad Inserter? It has this capability baked in, but it doesn't use widget areas.

Tom, look forward to having this feature as well. I didn't know it was so difficult, as we have it working in our site (using genesis framework theme).

Hi there,

You can most likely use the same method you're using now with Genesis with GP. Is it a plugin or a custom page template?

I had this in the functions.php

// BETWEEN Posts
genesis_register_sidebar( array(
'id' => 'between-post-content',
'name' => __( 'Between Posts', 'mm' ),
'description' => __( 'Section Between Posts', 'mm' ),
) );
add_action( 'genesis_after_entry', 'mm_between_post_content' );
function mm_between_post_content() {
global $loop_counter;
$loop_counter++;
if( $loop_counter == 2 ) {
if ( is_active_sidebar( 'between-post-content' ) ) {
    echo '<div class="between-post-content widget-area"><div class="wrap">';
	dynamic_sidebar( 'between-post-content' );
	echo '</div></div><!-- end .top -->';
	}
$loop_counter = 0;
}
}

Not sure if this will be of help. The intention was to have an ad b/w every two posts.

Hmm, not possible at the moment, but I think we should be able to add a hook in the next version that will achieve this.

I'll take a look :)

This archived topic is closed to new replies.