When an affiliate pixel breaks my site's layout

When an affiliate pixel breaks my site's layout

When adding an affiliate embeddable code to a post, we have to be very careful not to include unformatted HTML that might break our layout. Often, the code includes an invisible image that could take up too much space. This is really common, as you’ll see in this example:

This causes white space to appear after the link, and sometimes even a linebreak.

How to fix layout issues with affiliate links

Luckily, there is a quick and easy fix! 
Keep the links where they should appear, but move the image code to the end of the post, past the point where your content ends. This ensures the pageload tracking still works for your affiliate partner, while ensuring it doesn’t damage your layout.
To do this, ensure that you are in text editor mode, and move everything within (and including) the ... tags to the end of the post.

    • Related Articles

    • Performance Foundry affiliate programme

      We love it when people refer clients to us! If you tell someone about us, and they sign up for one of our services, we'd like to give you something back to say thanks. That's why we set up our affiliate programme. You'll get a $100 bonus for each new ...
    • Editing your hosts file on Windows to preview your site

      From time to time, we might ask you to set up virtual hosts on your machine, so you can see a development site before the world can.  We 'trick' your browser into seeing the new site, while the rest of the world is still looking at the old one! It ...
    • Using Virtual Hosts on OSX to preview your site

      From time to time, we might ask you to set up virtual hosts on your machine, so you can see the site before the world can.  We 'trick' your browser into seeing the new site, while the rest of the world is still looking at the old one! It takes just a ...
    • How do ad networks impact my site load time?

      Advertising networks are an important part of most publishers' business plans, but what impact do they have on performance? Using Dareboost, we tested two client sites using two different ad networks to see the resource usage. In both tests, we ...
    • What's the difference between a theme change and a full site redesign?

      When you change the look of your WordPress website, we're normally talking about changing your theme. A theme controls the layout, colours, and fonts of a site.  It is a preset package which contains a lot of information about the appearance and ...