Skip to content
Public Ticket #798

Ref #1333638

Conversation thread

tim-nieuwpoort replied

Customer Reply

Sure. I want to add 3 several banners under the menu. 1 at the homepage (done), 1 at posts (done), and 1 at pages https://screencast.com/t/1e2yqp5pX So thats the one that doesnt work yet.

\

Ofcourse I understand, but if there was space for the banner in the theme I didnt had to ask. It's a very important spot on the page, and the theme doesnt have it.. Can you please add it in the next update?

\

Therefore, I just paid an additional 60 dollars for the support. It's very import that you can help me with it.

\

Kind regards,

\

Tim Nieuwpoort

tim-nieuwpoort replied

Customer Reply

Hi,

\

Ok, thank you. But I want the same banner above ALL my pages (Pages, not posts). 

Just like I have the same banner above all my posts.

PenciDesign replied

Staff Reply

Hi,

You need to fill posts ID to this code:

\
<?php if( is_single() ): ?>

Example:

\
<?php if( is_single('14') ): ?>

You can check this guide to know how to find post id of a post.

Best Regards,

PenciDesign

tim-nieuwpoort replied

Customer Reply

And if I want another banner on a single page (not a post), what do I have to fill in for 'single'

\
<?php endif; ?>\
<?php if( is_single() ): ?>\
<div class="penci-google-adsense" style="margin: 20px 0;">\
put the codes here\
</div>

tim-nieuwpoort replied

Customer Reply

It works! Thank you so much! :)

PenciDesign replied

Staff Reply

Hi,

If so, please use this code:

\
<?php if( is_home() || is_front_page() ): ?>\
<div class="penci-google-adsense" style="margin: 20px 0;">\
put the codes here\
</div>\
<?php endif; ?>\
<?php if( is_single() ): ?>\
<div class="penci-google-adsense" style="margin: 20px 0;">\
put the codes here\
</div>\
<?php endif; ?>

Best Regards,

PenciDesign

tim-nieuwpoort replied

Customer Reply

Ok, thanks. But, I want 1 banner on the homepage (now there is place for 2 in your code), and 1 banner on a (single) post.

I deleted one in your code, but then my website crashed. Can you please sent me the code for 1 banner on the homepage en 1 for a (single) post.

Thank you

PenciDesign replied

Staff Reply

Hi,

\

If so, please use this codes replace with all the codes you have before on header.php file:

\
\
<?php if( is_home() || is_front_page() ): ?>\
<div class="penci-google-adsense" style="margin: 20px 0;">\
put the codes here\
</div>\
<div class="penci-google-adsense" style="margin: 20px 0;">\
put the codes here\
</div>\
<?php endif; ?>\
<?php if( is_single() ): ?>\
<div class="penci-google-adsense" style="margin: 20px 0;">\
put the codes here\
</div>\
<?php endif; ?>
\

On the above code,  one for 2 banners on the homepage, one for a banner on single posts page.

\

Let's replace with your banners.

\

Best Regards,

\

PenciDesign

tim-nieuwpoort replied

Customer Reply

Hi,

I don't understand you :) I want a different banner showed on the homepage than above a single post. So, I have 2 different banners.

Do I have to paste both codes in here?

\
<?php if( is_single() ): ?>\
<div class="penci-google-adsense" style="margin: 20px 0;">\
put the codes here\
</div>\
<?php endif; ?>

PenciDesign replied

Staff Reply

Hi,

Hmm, I think that you want to add more the banner.

If you want to add only a banner. You can remove the codes for the first banner - keep the codes I give you recent.

Best Regards,

PenciDesign

PenciDesign replied

Staff Reply

Hi,

If so, please put the code:

\
<?php if( is_single() ): ?>\
<div class="penci-google-adsense" style="margin: 20px 0;">\
put the codes here\
</div>\
<?php endif; ?>

To header.php file - below the code I sent it for you before:

\
<div class="penci-google-adsense" style="margin: 20px 0;">\
put your google adsense code here\
</div>

Best Regards,

PenciDesign

tim-nieuwpoort replied

Customer Reply

Hi,

Yes, same place under the menu indeed, for all my posts.

Kind regards,

Tim Nieuwpoort

PenciDesign replied

Staff Reply

Hi,

Do you mean you want to put the banner at the same place ( under the menu ) for only a post OR all your posts? 

Best Regards,

PenciDesign

tim-nieuwpoort replied

Customer Reply

Yes, that's correct. I added it in the header.php folder. But, this banner shows on every page. Now, I'd like another banner above a post. So thats why I asked in which folder I have to add the adsense code. You told me to put it in the content-single.php file. No I'd like to know where exactly in this file.

Kind regards,

Tim Nieuwpoort

tim-nieuwpoort started the conversation

Conversation Start

Hi,

I refer to ticket  #1333638

Last comment. Where can I add the code in the folder? The banner must be placed under the menu (just like at my homepage)

Kind regards,

Tim Nieuwpoort

Want to join this conversation or access attachments? Sign in first.