Social Options

Add a new social media service
Load the model.
The first arg is the handle, the second arg is the Name.

Loader::model(‘social’, ‘theme_options_lite’);
Social::add('rss', 'RSS');

To set a default value there is a 3rd arg,

Social::add('rss', 'RSS', '');

Social::add() returns a Social Object.

Get a Social Object:
Load the model.
You can either get by ID or handle, (handle is usually easier).

$so = Social::getByHandle($handle);
$so = Social::getByID($cID);

Once you have the object you can do the following:

Set values:


Get values:


Delete Social Networks:


Example Usage:

if(is_object(Loader::package('theme_options_lite'))) {
//load the model
Loader::model('social', 'theme_options_lite');
//get some social networks
$twitter = Social::getByHandle('twitter');
$facebook = Social::getByHandle('facebook');
//now we check if there is actually a network with that handle, and that its not blank
if(is_object($twitter) && $twitter->getValue() != '') {
//print it out!
echo '<a class="twitter" href="'.$twitter->getValue().'">'.$twitter->getName().'</a>';
if(is_object($facebook) && $facebook->getValue() != '') {
echo '<a class="facebook" href="'.$facebook->getValue().'">'.$facebook->getName().'</a>';


Mobile Options

If Theme Options Lite detects a mobile a device, a global define will be set, and can be used as follows:

//its a mobile device!