Tuesday, July 7, 2020
Insert Ads inside the WordPress Blog Post Content
nsert-post-advertisements/ Step 4Now clnsert advertisements after second section of single post content. add_filter( 'the_content', 'prefix_insert_post_ads' ); work prefix_insert_post_ads( $content ) { $ad_code = 'divPaste your Ads code here'; on the off chance that ( is_single() ! is_admin() ) { return prefix_insert_after_paragraph( $ad_code,2, $content ); } return $content; } work prefix_insert_after_paragraph( $insertion, $paragraph_id, $content ) { $closing_p = '/p'; $paragraphs = detonate( $closing_p, $content ); foreach ($paragraphs as $index = $paragraph) { on the off chance that ( trim( $paragraph ) { $paragraphs[$index] .= $closing_p; } on the off chance that ( $paragraph_id == $index + 1 ) { $paragraphs[$index] .= $insertion; } } return implode( '', $paragraphs ); } Stage 4 Finally Click on Update File Button from base of the screen. Customization Supplant Paste your Ads code here with your promotion code. Change 2 for showing the quantity of passage where advertisement will show up. Expectation with the assistance of this instructional exercise you would ready to show Ads inside WordPress Blog post body. What's more, on the off chance that you think this instructional exercise help you, at that point sympathetically consider to like our Facebook Fan page.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.