WordPress SDK

WordPress is a flexible and popular content management system for creating websites. This page shows you how to add a linket for use in WordPress. This will require creating a button and adding attributes to the button which will allow our code to use it as a linket.

First, you must add a button to the page, then you can “edit HTML” to change its source code. This can be done on the individual element or for the page using the “Code editor”. When you are done, it  must look like this:

<button id="linketButton">[ Flowers ]</button>

Notice the id is “linketButton” which will allow you to use this one linket on a page. The content of the button is [ Flowers ]. The linket is Flowers and the brackets [ ] are optional.

Alternatively, for more than one link, uses classname this way.

<button class="linketgroup">[ Flowers ]</button>
<button class="linketgroup">[ Candies ]</button>
<button class="linketgroup">[ Fruit ]</button>

Notice the classname is “linketgroup” which will allow you to add more than one linket per page. For an example of a page of linkets in a WordPress website, see ours.

The code for using a button and communicating with the Linket API server is written in Javasript. However, in order to use Javascript in WordPress it must be included properly in a WordPress page. To this aim, we are modifying the functions.php file of the active theme. Best practice behooves one to create a child theme and place this code there, not in the parent theme’s functions.php for fear of a Theme upgrade wiping out this code.

The WordPress functions.php code for more than one linket per page (using classname “linketgroup”) is available here.

At this time, it is recommended to use the classname approach for adding linkets in WordPress. If the desire is to use a single linket, you can see that it is similar to the HTML SDK approach.

Congratulaions, you now have a powerful tool for controlling your brand with the largest web platform in the world.