Sunday, June 20, 2010

How to set up linKWorth code for Wordpress blog?

Some customer need to insert linKworth ad to theire Wordpress blog.  However, he did not want to use the plugin. In addition, he wanted to combine LinkWorth ads with other ad networks inside one widget. The reasoning was to limit the number of widgets displaying on the sidebar. Today there is a new customer requesting the exact same thing, so I felt it might be useful to post an alternative option for anyone else looking for the same thing.
The problem with using our PHP File Inclusion inside a text widget is, the text widget does not parse PHP code. You can only put HTML or JavaScript inside these widgets.
If you do not want to use our plugin (which is the easier option since it incorporates almost all of our products), you are able to use our PHP File Inclusion publish option inside a widget, along with other ad network publish codes by following these steps.
  1. Install this PHP Code Widget plugin and activate it.
  2. Go to the widgets section and place the “PHP Code” widget where you want it to appear.
  3. Grab your File Inclusion PHP code from your LinkWorth account and insert it into the widget.
  4. Save the widget information and you’re done!
Here is a screenshot of how the widget will look with the LinkWorth code in, along with how you can publish other ad network code and html:
So you may choose between publishing a ‘home page only’ ad, you need to tell WordPress it should only be on the home page. You do so by adding this codebefore the LinkWorth code:
< ?php if(is_front_page()){ ?>
and then you add this code after the LinkWorth code:
< ?php } ?>
Or " all pages ads"
Here is a screenshot of how it will appear in the widget:
On other hand, there are also sub page links, but this gets a bit messy. You’ll definitely need to understand the WordPress conditional tags and make sure what you enter on your blog matches what you have setup with LinkWorth. For more info on this, you can read about it over at WordPress.
**Side Note**
The LinkWorth File Inclusion code examples used above should be replaced with the code found in your account. We used example code that does not work.

No comments:

Post a Comment