• Resolved Pixyweb

    (@pixyweb)


    Hi,

    It’s possible to add a custom code below an ad.
    Is it possible to add a global custom code for all ads?

    Thanks for your help.

    Regards,
    Greg

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support schmidt25

    (@schmidt25)

    Hi Greg,

    Thanks for reaching out.

    It’s possible to add a custom code below an ad.

    You can add custom codes to your ads using Advanced Ads Pro, for example, to modify ads to have rounded corners. Here, you can find the manual about adding custom code to your ads.

    Is it possible to add a global custom code for all ads?

    If this is possible depends on what you want to achieve exactly.

    In general, each placement has an own class that you can address with global custom CSS. You can also add individual classes to single ad units in the layout section.

    I hope that helps you.

    Best regards,
    Joachim

    Thread Starter Pixyweb

    (@pixyweb)

    Hi Joachim,

    Thank you for your prompt reply. ??

    What I want to achieve is to display the same message below all banners.
    In fact I would like to display the following message “Click here to publish your ad”. Instead of adding this message as a custom code for each ad it would be great to have this message added automatically.

    Do you understand what I mean?

    Best Regards,
    Greg

    Thread Starter Pixyweb

    (@pixyweb)

    Hi Joachim,

    Is it possible to do what I want or not?
    Thanks for your help.

    Best Regards,
    Greg

    Plugin Support schmidt25

    (@schmidt25)

    Hi Greg,

    Thanks for your explanation. I understand what you mean.

    There is not such a function out of the box, and I also searched in our custom code section for anything related. You might also take a look at our codex.

    I was thinking about the easiest way to solve this. How about using the ad label function for your purpose?

    You can find a description in the ad label tutorial on how you can address this with CSS. I would try to link these ad label elements globally afterward.

    Best regards,
    Joachim

    Thread Starter Pixyweb

    (@pixyweb)

    Hi Joachim,

    I try with the the ad label but it’s only text, I cannot insert HTML. How can I do if I want to add a link to the text?

    Best Regards,
    Greg

    Plugin Support schmidt25

    (@schmidt25)

    Hi Greg,

    You would add the HTML externally by addressing the ad label class.

    I thought about this issue again. The workaround via the ad label is not elegant. You could technically replace the ad label text and insert a link with custom code. This is not my specialty, and you can find better examples on StackOverflow, but basically, you could do it like in this example.

    However, it would be more elegant not to replace and rewrite the ad label but to automatically place the custom code above the elements of the placements, which each have their classes. From experience, most websites don’t have more than a dozen placements, somewhat significantly fewer. It would therefore be cleaner to include your code in front of the elements of these classes than to manipulate the ad label.

    You can find code examples on StackOverflow, e.g., here.

    This method would still mean less effort than adding custom code to every ad.

    I have one last workaround that doesn’t require you to write any code.

    1. Build the text link you want to display above the ad using Advanced Ads.
    2. Create an ad group for each placement in ordered group mode and give this ad the highest ad weight.
    3. Set the number of visible ads to 2.

    The ad with the text link will always be displayed before the other ad of this placement. This seems to be the most straightforward and cleanest variant of all possibilities.

    Best regards,
    Joachim

    Thread Starter Pixyweb

    (@pixyweb)

    Hi Joachim,

    Thanks again for your help.

    I follow your any code solution, it works great.

    Best Regards,
    Greg

    Plugin Support schmidt25

    (@schmidt25)

    Hi Greg,

    Great to hear this good news.

    Next time, I’ll be faster in pointing out how easy it is to solve this problem ??

    Best regards,
    Joachim

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Global custom code’ is closed to new replies.