In admin page under settings (general) I have this
Say I'd like to add a few sites. Lets say Tumblr and Linkedin to make it look like this
In my sidebar.php I now have:
Code: Select all
<?php
if($Site->twitter()) {
echo '<a href="'.$Site->twitter().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_tweet.png" title="Twitter"></a>';
}
if($Site->facebook()) {
echo '<a href="'.$Site->facebook().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_fb.png" title="Facebook"></a>';
}
if($Site->instagram()) {
echo '<a href="'.$Site->instagram().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_insta.png" title="Instagram"></a>';
}
if($Site->github()) {
echo '<a href="'.$Site->github().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_git.png" title="Github"></a>';
}
if( $plugins['all']['pluginRSS']->installed() ) {
echo '<a href="'.DOMAIN_BASE.'rss.xml'.'"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_rss.png" title="RSS"></a>';
}
if( $plugins['all']['pluginSitemap']->installed() ) {
echo '<a href="'.DOMAIN_BASE.'sitemap.xml'.'"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_sitemap.png" title="Sitemap"></a>';
}
?>
Sure, I could use the fields I am currently not using, but it would make more sense to me to actually add a couple instead
So...
What would I need to do (step-by-step) to add new fields in admin (social network links) and then present them (if filled in) on my page?
I'm guessing the presenting is the easy part and just copy/paste from the existing part and put out:
Code: Select all
if($Site->linkedin()) {
echo '<a href="'.$Site->linkedin().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_linkedin.png" title="Linkedin"></a>';
}
if($Site->tumblr()) {
echo '<a href="'.$Site->tumblr().'" target="_blank"><img width="32" height="32" src="../../bl-themes/future-imperfect/img/soc_tumblr.png" title="Tumblr"></a>';
}
Thanks!