About Sridhar Katakam
I am an independent WordPress web consultant with 10 years of experience in WordPress theme installation, customization, administration, maintenance, support, documentation, troubleshooting and PSD/design to WP.
Genesis and WordPress Tutorials
Session expired
Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.
Is there a way to show [shortcode] in between every 2 posts?
Love it.
Same method as Sridhar mentioned and replace line 26 with echo do_shortcode( ‘[shortcode]’ );
Ref – http://codex.wordpress.org/Function_Reference/do_shortcode
Sorry so long to get back to ya, I tried the shortcode fix but it results in kiling site till i replace it with Srihars’
code. ( i copy pasted exactly)
any idea why?
Hello. Is there a way to show content (ad, image, shorcode etc) in between for example the 2nd and third post, and then in between the 4th and 5th (but then NOT in between any other posts in that page?
Thanks,
Chris
Hi Chris,
The code in this tutorial is for inserting ads between 2nd and 3rd, 4th and 5th posts and so on. Isn’t that what you are asking?
Not quite – I would be interested in how to then STOP any repeated insertion of content after the 4th & 5th – so there are only 2 ads in the flow of all the posts, even when the user has clicked through to subsequent paginated pages…
Ok, understood now.
Try this: http://pastebin.com/raw/fdJxrN2B
Thanks Sridhar,
I ended up using this:-
add_action( ‘genesis_after_entry’, ‘fd_category_clients’ );
function fd_category_clients() {
if ( is_paged() ) {
return;
}
global $wp_query;
if( ($wp_query->current_post) == 1 ) {
// added content here
}
elseif( ($wp_query->current_post) == 3 ) {
// added content here
}
}
In conditional hook box using Dynamik… works a treat.
Thanks loads for your code too – it’s great to see that the idea is the same so re-inforces what I’m doing is correct and I needed the
if ( is_paged() )
{
return;
}
part so thanks for that 🙂
Chris