I want to put a widget area into the content of the first post. My problem though is that is can't figure out how to get only the first post in my function. Here is my function:
function pietergoosen_insert_content_filter( $content ) {
ob_start();
$sidebar = dynamic_sidebar('sidebar-19');
$new_content = ob_get_clean();
if ( ! is_admin() ) {
return pietergoosen_insert_content( $new_content, 2, $content );
}
return $content;
}
If i replace
if ( ! is_admin() ) {
with
if ( ! is_admin() || is_paged() || $wp_query->current_post > 0 ) {
it shows the widget in all other posts and not in the first post. Any suggestions on a conditional tag for this