Social icons at sidebar

ClassiBase classifieds script Forums General help Social icons at sidebar

This topic contains 0 replies, has 0 voices, and was last updated by  info 2 years, 1 month ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2128 Reply

    info

    For those who may want to have their social icons at side bar, I share what I’ve done for myself:

    1. Create a css file (name it style.css) and upload it to yoursite . com/public/yourstylelocation/
    This is the content

    ul.social{}
     ul.social li {float:left;padding:0 2px 0 0;list-style:none;}
     ul.social li a {display:block;width:32px;height:32px;}
     ul.social li a.rss {background: url('./social/icon_rss.png') no-repeat;}
     ul.social li a.fb {background: url('./social/icon_facebook.png') no-repeat;}
     ul.social li a.tw {background: url('./social/icon_twitter.png') no-repeat;}

    2. Upload the icons png files (see names above) to yoursite . com/public/yourstylelocation/social/
    You can get icons here https://www.iconfinder.com/

    3. At admin panel /settings / header/footer add this line to your custom header

    <link rel="stylesheet" href="/public/yourstylelocation/style.css"/>

    4. At admin panel /appearence / widgets add the code below, as text, at the area you want it displayed.
    Be sure to mark it as PHP format.
    Hope it works (it does for me…) and you enjoy it

    <?php
     $selected_category = self::$_vars['selected_category'];
     $selected_location = self::$_vars['selected_location'];
     $base = BASE_URL;
     $latest = 'rss/';
     $featured = 'rss/featured/';
     $rss_latest = __('RSS latest ads');
     $rss_featured = __('RSS featured ads'); 
     if($selected_category)
     {
     $arr_page_title[0] = View::escape(Category::getName($selected_category));
     $y_url = Location::url($l, $selected_category);
     $categ = str_replace(BASE_URL, "", $y_url);
     $latest .= 'latest/';
     $rss_latest .= ':';
     $rss_featured .= ':';
     }
     if($selected_location)
     {
     $arr_page_title[1] = View::escape(Location::getName($selected_location));
     $y_url = Location::url($selected_location, $l);
     $local = str_replace(BASE_URL, "", $y_url);
     if(!$selected_category) {
     $latest .= 'latest/';
     $rss_latest .= ',';
     $rss_featured .= ',';
     }
     else {
     $arr_page_title[1] = ', '. $arr_page_title[1]; 
     }
     $latest .= $local;
     $featured .= $local;
     }
     $social = ""; 
     $social .="<ul class=\"social\">"; 
     $social .= "<li><a href=\"$base$latest$categ\" class=\"rss\" title=\"$rss_latest $arr_page_title[0]$arr_page_title[1]\"></a></li>";
     $social .= "<li><a href=\"$base$featured$categ\" class=\"rss\" title=\"$rss_featured $arr_page_title[0]$arr_page_title[1]\"></a></li>";
     $social .= "<li><a href=\"https://www.facebook.com/yourusername\" target=\"_blank\" class=\"fb\" title=\"Follow us on Facebook\"></a></li>";
     $social .= "<li><a href=\"https://twitter.com/yourusername\" target=\"_blank\" class=\"tw\" title=\"Follow us on Twiter\"></a></li>";
     $social .="</ul>";
     echo $social . '<br/>';
    ?>
Viewing 1 post (of 1 total)
Reply To: Social icons at sidebar
Your information:




This entry was posted on by .