-
Author
-
February 12, 2016 at 08:02 #103470ericliandaParticipant
How can I add google adsense so my website can profit from advertisements while running sweetdate theme?
February 12, 2016 at 19:17 #103612RaduModeratorHi,
For sidebars you can paste your adsense code into a text widget in your desired sitebar,
Where do you want to place another adsense ads ?
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionFebruary 12, 2016 at 21:39 #103630ericliandaParticipantHi Radu,
Thanks, for now I want to place the adsense code in the sidebar. Is there a documentation of where exactly the code will be put? or a link you can guide me to?February 14, 2016 at 23:20 #103881thannahParticipantWhat about adding it to buddypress activity stream or a banner ad on the top of the activity page? I’ve been working with it and the code works fine I just can’t get it to show up on this particular page. What could I be doing wrong?
February 15, 2016 at 18:40 #103983RaduModeratorHi ericlianda,
Please go to wp-admin -> appearance -> widgets -> add to main sidebar widget named Text and paste your adsense code.
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionFebruary 15, 2016 at 18:42 #103984RaduModeratorHi thannah,
Please add this php snippet to your child theme /functions.php ( wp-content/themes/sweetdate-child/functions.php )
COPY CODEfunction banner_before_activity() { echo '<div class="row">'; echo '<img src="http://northdelawhere.happeningmag.com/wp-content/uploads/728x90-example-banner-600x90.jpg">'; echo '</div>'; } add_action ('bp_before_directory_activity_page', 'banner_before_activity');
Replace
COPY CODE<img src="http://northdelawhere.happeningmag.com/wp-content/uploads/728x90-example-banner-600x90.jpg">
with your desired code.
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionFebruary 16, 2016 at 18:28 #104155RaduModeratorYou’re welcome
Have a nice week
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMarch 10, 2016 at 19:21 #109836Loyal_CustomerParticipantHi,
Which file do I need to edit to place the AdSense code between member rows on the Member Search page? (The circled area in the attached screenshot).Attachments:
You must be logged in to view attached files.March 14, 2016 at 15:59 #110354RaduModeratorHi,
Add the attached file to wp-content/themes/kleo-child/buddypress/members/members-loop.php
Then open the file look around line 40 and replace the follwing
COPY CODE<img src="http://s3.amazonaws.com/fotor.onlineresource/0b2c5f2b80b24f1a9cb6951e6c48ca50/0b2c5f2b80b24f1a9cb6951e6c48ca50_o.jpg">
place inside ” you adsense code
COPY CODEecho '<img src="http://s3.amazonaws.com/fotor.onlineresource/0b2c5f2b80b24f1a9cb6951e6c48ca50/0b2c5f2b80b24f1a9cb6951e6c48ca50_o.jpg">';
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAttachments:
You must be logged in to view attached files.March 16, 2016 at 18:56 #111018Loyal_CustomerParticipantHi Radu,
Thank you for your response. I noticed you mentioned “kleo-child,” but the theme I’m working with is Sweetdate. Please what are the instructions for Sweetdate?
March 17, 2016 at 16:45 #111270RaduModeratorHi,
Yes you right, my bad,
Use the attached file and upload it to wp-content/themes/sweetdate-child/members
NOTE : The child theme needs to be activated.
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAttachments:
You must be logged in to view attached files.April 8, 2016 at 00:13 #115181Loyal_CustomerParticipantHi Radu,
Thanks. I tried the file code, but there doesn’t seem to be enough room for an ad to fit between the small space. How can I increase the space size between the two rows to make it wider? (Please see attached screenshot).
Attachments:
You must be logged in to view attached files.April 8, 2016 at 16:42 #115308RaduModeratorPut all your add code in a div like this
COPY CODE<div style="display: inline-block !important;"> Your add code </div>
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 8, 2016 at 16:46 #115310Loyal_CustomerParticipantYou wrote “div like this” but there’s no example. I’m not sure if your entire message came through.
April 8, 2016 at 17:32 #115329RaduModeratorI’ve forgot to place code tags and the div was rendered, sorry for that check now
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 8, 2016 at 21:09 #115394Loyal_CustomerParticipantOkay. Do I put the div code before or after the the img src part?
For example:
echo ‘<div style=”display: inline-block !important;” <img src=”(ADSENCE CODE HERE)”/’; CLOSE DIV
OR
echo ‘<img src=” <div style=”display: inline-block !important;” (ADSENCE CODE HERE) CLOSE DIV “/’
April 11, 2016 at 12:59 #115583RaduModeratorIF you will using an adsense code you will no need the img so the code will be like this
COPY CODEecho = ' <div style="display: inline-block !important;"> Your add code </div> ';
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 13, 2016 at 22:09 #116413Loyal_CustomerParticipantHi Radu,
I appreciate your help. I copy and pasted the code into the Members-loop file exactly as you stated, and replaced the words “your ad code” with my actual ad code, but it makes the everything on the Members directory below the words “Members” disappear.
What might be causing this to happen?
April 14, 2016 at 16:10 #116584RaduModeratorThis type of issue can be caused by the code that ar you paste more exactly a JS error
If you have a js code paste with with
<script> tags </script>
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 14, 2016 at 18:21 #116636Loyal_CustomerParticipantHi Radu,
I’m not able to read your last reply, since it’s marked as “private.”
April 15, 2016 at 16:41 #116839RaduModeratorcheck now
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 20, 2016 at 18:55 #117989Loyal_CustomerParticipantThanks. The AdSense code is already enclosed in “script” and the member page content is now okay. However, the ad is showing up partially behind the member box rows (Please see attached screenshot).
I’m trying to make the space between the rows bigger using the code you gave me earlier (“div style=”display: inline-block !important;”). However, when I put the code around the AdSense code, the ad on the page completely disappears.
Is there another way to increase the space between profile box rows?
Attachments:
You must be logged in to view attached files.April 20, 2016 at 22:55 #118029RaduModeratorTry to add beside the display:inline-block height:90, from example
COPY CODE<div style="display: inline-block !important; height:90px !important; margin:10px 0 !important ;"> Your add code </div>
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 21, 2016 at 19:47 #118236Loyal_CustomerParticipantThe “div style” code is still causing the ad to not show up on the page.
Also, I realized that putting an AdSense code anywhere on the Members-loop file makes the page number buttons at the bottom of the page completely non-functional.
For example, when you are on page 1 of the members directory, everything is fine, but as soon as you click the “2” button, it takes you to a blank page that says “Members” at the top, but no members appear (Please see attached screenshots).
In order to avoid this problem, is there any way to embed the code somewhere on the Members Directory page without affecting the functionality of the number buttons located at the bottom?
Attachments:
You must be logged in to view attached files.April 22, 2016 at 16:23 #118381RaduModeratorHi,
On my install with the code that i have provided to you i can change the page with no problem,
Are you sure the issue is caused by that code ? Maybe other is problem a plugin or other code from child ?
R.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 23, 2016 at 23:06 #118628Loyal_CustomerParticipantHi,
I realized that the issue is most likely being caused by the AdSense code itself, and not the div code.
When I removed the AdSense code and replaced it with a regular “img src=” picture banner, the page numbers started to work again.Are you testing it out on your install with an actual AdSense code?
If not, could you please test it with an AdSense code and let me know if it still lets you change the page without any issues?
I would like to try and see if there’s any way to fix this if the AdSense code format is what’s really causing the problem.
Thank you.
April 25, 2016 at 19:37 #118826RaduModeratorHi,
I’ve using an dummy adsense account for testing and there is only a empty space (white space) but if i change page the ad-place is empty (white ) and in source code the iframes from the ad are loaded but it shows white instead of any ad and the rest of layout shows ok.
Cheers
R.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionApril 25, 2016 at 19:41 #118828Loyal_CustomerParticipantThe members on the next page don’t disappear when you change the page from 1 to 2 when you have the AdSense code on the page?
April 25, 2016 at 19:48 #118834RaduModeratorMy code doesn’t show blank because i’m localhost, anyways i’ve found this
https://productforums.google.com/forum/#!topic/adsense/kqVvPLEAeRs
It seems that adsense doesn’t work with ajax, but you can try to disable ajax pagination, please follow this : https://buddypress.org/support/topic/custom-members-directory-breaks-pagination/#post-169329 it seems that you will need to put no-ajax on pagination div
Cheers
R.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMay 18, 2016 at 00:19 #122165Loyal_CustomerParticipantHi Radu,
Thank you for the links.
Sorry for the late response. I didn’t see your reply until today.You’re right— Ajax was the problem, and the issue has been resolved. Thanks for all your help!
May 18, 2016 at 18:43 #122272RaduModeratorHi,
No problem
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.