Community Forums › Forums › Archived Forums › Design Tips and Tricks › Widget between the first and second paragraph
- This topic has 11 replies, 4 voices, and was last updated 7 years, 5 months ago by
Dan Merry.
-
AuthorPosts
-
October 10, 2015 at 6:12 pm #167810
Dan Merry
ParticipantHello everyone here, I'm new at this forum and need help to accomplish something I want.
I need to add a widget area for to place Adsense ads in between the first and second paragraph on every post in my blog.
I'm using Agency Pro theme.
Can some one here help me please?
TANKS 🙂October 10, 2015 at 8:47 pm #167816Victor Font
ModeratorYou need a plugin like this one: https://wordpress.org/plugins/amr-shortcode-any-widget/
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?October 10, 2015 at 10:04 pm #167819Dan Merry
ParticipantHi Victor, thank for your replay, I appreciate it.
Any way, is there a way to do that without a plugin?? I prefer to do it without plugin.
Thanks in advance my friend.October 11, 2015 at 3:32 pm #167865Victor Font
ModeratorYou need to use the plugin. A widget area is technically a sidebar. I don't know of any other way to insert a widget between paragraphs without using a shortcode.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?October 11, 2015 at 4:23 pm #167873Brad Dalton
ParticipantI wrote 2 tutorials about how to do this however they're for members only who don't mind paying for custom code.
You might try searching Google as i think there are several freely accessible code snippets out there. May need to modify them a bit to work with Genesis.
October 11, 2015 at 7:13 pm #167877Dan Merry
ParticipantHello guys, thanks a lot for you take care of my question.
Brad I got the following piece of code from your post in gist.github, can you please tell me what would I have to edit in it?
/*** @author Brad Dalton - WP Sites @link http://wpsites.net/web-design/ads-specific-paragraph-single-posts/ ***/ add_filter( 'the_content', 'wpsites_adsense_middle_content' ); function wpsites_adsense_middle_content( $content ) { if( !is_single() ) return $content; $paragraphAfter = 3; //Enter paragraph number $content = explode ( "</p>", $content ); $new_content = ''; for ( $i = 0; $i < count ( $content ); $i ++ ) { if ( $i == $paragraphAfter ) { $new_content .= '<div style="width: 600px; height: 100px; padding: 5px 5px 5px 0; margin-right: 0;">'; $new_content .= 'Paste Adsense Code Here'; $new_content .= '</div>'; } $new_content .= $content[$i] . "</p>"; } return $new_content; }
THANK YOU very much.
October 11, 2015 at 7:44 pm #167883Brad Dalton
ParticipantHi Dan
Read this please http://wpsites.net/disclosure-privacy/
And this http://www.studiopress.community/policies-and-guidelines/
October 11, 2015 at 7:47 pm #167884Dan Merry
ParticipantHi Brad I realize that I have to add the Adsense code and set the number of paragrph, but what about the following line?
wpsites_adsense_middle_content
Do I have to change something in that line?
Thanks again.
October 11, 2015 at 8:00 pm #167886Dan Merry
ParticipantOH!!! I'm so sorry Brad, I didn't know that 🙁
October 11, 2015 at 8:04 pm #167887Brad Dalton
ParticipantNo worries. The code should work if you add it in your functions file.
If you need modification to it, you will need membership.
October 11, 2015 at 9:57 pm #167888nongtinh3
MemberI wrote 2 tutorials about how to do this however they’re for members only who don’t mind paying for custom code.
October 12, 2015 at 6:33 am #167906Dan Merry
ParticipantHi Brad thanks, and thanks for you recommend wpsite to me, I'm considering be a member, seems that for any need with Genesis there is a snippet or a code.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.