/** * Prints HTML for sharing links list on selected pages. */ function share_links() { /* Get array of pages for which sharing links are to be displayed */ $conditionals = get_theme_mod('theone_share_conditionals', array('is_home', 'is_archive', 'is_singular')); /* If array contains `none`, quit */ if (in_array('none', $conditionals)) { return; } /* Get position: top, bottom, side, or fixed */ $position = get_theme_mod('theone_share_position', 'fixed'); /* If position is not "fixed", add a `base` prefix. */ if ('fixed' !== $position) { $position = 'base ' . $position; } /* Get selected pages to display links on */ if (share_conditionals()) { echo get_share_links($position); } }
function share_links($url, $title, $class = 'sharing-list', $icon_prefix = 'fa fa-') { echo get_share_links($url, $title, $class, $icon_prefix); }