Custom Styling for Sponsored Posts

By default, your theme will display your sponsored post using the same fonts, colors, and style as the rest of your site. This is because your theme has not been coded to display sponsored posts. To change the look of a sponsored post, you have two options. You can choose to change the sponsored post template in the WP Sponsored Post settings, or you can update your theme stylesheet to include the "sponsor" CSS class.

To edit your sponsored post template directly, login to the Wordpress admin area, then browse to the WP Sponsored Posts settings page. Here you can edit the theme with additional formatting or CSS.

Sponsored Post Template

For instance, to add a red border to your sponosed post with a yellow background, you could update the sponsor div style so that the sponsor template looks like this:

<div id="post-[PostID]" class="sponsor" style="border: 1px solid #FF0000; background-color:#FFFBCC;">
<h2><a href="[PostLink]">[PostTitle]</a></h2>
<small>Sponsored Post</small>
<div class="entry">
[PostBody]
</div>
</div>

To update your theme stylesheet, edit your theme CSS and add style to the "sponsor" class. So in the above example of showing a red border on a yellow background, you would add this to your stylesheet:

.sponsor {
border: 1px solid #FF0000;
background-color: #FFFBCC;
}

This entry was posted on Thursday, December 10th, 2009 at 10:40 am and is filed under Documentation. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.