<?php
//Insert ads after second paragraph of single post content.
add_filter( 'the_content', 'prefix_insert_post_ads' );
function prefix_insert_post_ads( $content ) {
$ad_code = '<div>Ads code goes here</div>';
if ( is_single() && ! is_admin() ) {
return prefix_insert_after_paragraph( $ad_code, 2, $content );
}
return $content;
}
Hi, how to repace
<?php
$a1 = get_field('fa1', 'option');
if ($a1) : ?>
<a href="<?php echo $a1['a1-l']; ?>" target="_blank" rel="nofollow"><img src="<?php echo esc_url( $a1['a1-b']['url'] ); ?>"></a>
<?php endif; ?>
instead of <div>Ads code goes here</div>
in functions.php
Wordpress?