Notifications
Clear all

Paid Addons Support Forum Only

Please note, that here we only support Paid Addons issues and questions.

gVectors Support staff works from 6am to 6pm (GMT+0)

All questions related to wpForo and wpDiscuz free plugins should be asked in the corresponding plugin support forum:

 

wpDiscuz Support Forum wpForo Support Forum

[Solved] Show Ads only to Unregistered Users


st7878
Posts: 22
Topic starter
(@st7878)
Eminent Member
Joined: 2 months ago

And, is it possible to show ads only to unregistered users?

7 Replies
st7878
Posts: 22
Topic starter
(@st7878)
Eminent Member
Joined: 2 months ago

I want to buy wpForo Ads Manager. But I need to know if it is possible to disable ads for registered users (logged in to the account). So that the advertisement is visible only to unregistered users.

Kyle
Posts: 120
 Kyle
Admin
(@kylew)
Member
Joined: 4 months ago

Hi @st7878,

Sorry for late response, Yes you can do that.

st7878
Posts: 22
Topic starter
(@st7878)
Eminent Member
Joined: 2 months ago

Hello. I bought this addon. Super! Thanks!

There is one question. I see such errors in the console (see screenshot). This is fine?

Error
1 Reply
Kyle
 Kyle
Admin
(@kylew)
Joined: 4 months ago

Member
Posts: 120

@st7878,

The error is not related to wpForo, check the Google documentations about AdSense for more information.

st7878
Posts: 22
Topic starter
(@st7878)
Eminent Member
Joined: 2 months ago

So that there is no such mistake

"adsbygoogle.push() error: Only one AdSense head tag supported per page. The second tag is ignored."

Сan anyone come in handy. Google generates a code with a script that is already on the site. Therefore, the script itself does not need to be inserted into the declaration. Google gives this code:

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9054324840403095"
     crossorigin="anonymous"></script>
<!-- Медийное горизонтальное -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-9054324840403095"
     data-ad-slot="7010327644"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

but you need to insert this:

<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-9054324840403095"
     data-ad-slot="7010327644"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
2 Replies
Kyle
 Kyle
Admin
(@kylew)
Joined: 4 months ago

Member
Posts: 120

@st7878,

1. Download and Install "Code Snippets" Plugin for WordPress

2. Open Dashboard > Snippets > Add New 

3. Write a Title

4. Add the Below Code, Check the "Only run on site front-end" Checkbox and press Save Changes and Activate

add_action( 'wp_footer', function () { ?>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9054324840403095"
     crossorigin="anonymous"></script>

<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
<?php } );

5. Insert the below HTML Code in the banner you created for the ads from Dashboard > Forums > Ad Manager > Current Banner

<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-9054324840403095"
     data-ad-slot="7010327644"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
st7878
(@st7878)
Joined: 2 months ago

Eminent Member
Posts: 22

@kylew so only shows one ad. since the first script is global and the second script must come with every ad. my version (above) works great.

Share:
Scroll to top