rearranged social icon handling, implemented shortcodes, front-page now uses page content
This commit is contained in:
parent
573dcbf799
commit
d29641d700
12 changed files with 250 additions and 147 deletions
|
@ -10,28 +10,19 @@ define( 'WP_73k_DIR', __DIR__ );
|
|||
define( 'WP_73k_URL', get_template_directory_uri() );
|
||||
|
||||
/**
|
||||
* Function to support inline SVG icons by name with div wrapper
|
||||
*/
|
||||
function svg_icon_use($icon_name, $div_class) {
|
||||
$output = "<div class=\"$div_class $icon_name\"><svg class=\"$icon_name\" aria-hidden=\"true\">";
|
||||
$output .= "<use xlink:href=\"" . get_stylesheet_directory_uri() . "/dist/images/icon-sprites.svg#$icon_name\"></use>";
|
||||
return $output . "</svg></div>";
|
||||
};
|
||||
|
||||
/**
|
||||
* Social helpers
|
||||
* Social icons definition & functions
|
||||
*/
|
||||
require_once( WP_73k_DIR . '/socials.php' );
|
||||
function socials_str($socials) {
|
||||
$out_str = '<div id="social-icons" class="mt-1">';
|
||||
foreach ($socials as $i=>$social) {
|
||||
$pad = $i == 0 ? 'pe-1' : ($i == (count($socials) - 1) ? 'ps-1' : 'px-1');
|
||||
$out_str .= '<a href="' . $social['url'] . '" rel="noreferrer" target="' . $social['target'];
|
||||
$out_str .= '" class="fs-3 link-light text-decoration-none ' . $pad . '">';
|
||||
$out_str .= svg_icon_use($social['icon'], "icon baseline") . "</a>";
|
||||
}
|
||||
return $out_str . '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom functions
|
||||
*/
|
||||
require_once( WP_73k_DIR . '/custom-functions.php' );
|
||||
|
||||
/**
|
||||
* Custom shortcodes for use in content
|
||||
*/
|
||||
require_once( WP_73k_DIR . '/custom-shortcodes.php');
|
||||
|
||||
/**
|
||||
* Autoloader for browersync
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue