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
42
custom-shortcodes.php
Normal file
42
custom-shortcodes.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
require_once( WP_73k_DIR . '/socials.php' );
|
||||
|
||||
/**
|
||||
* Shortcode to insert line of social icons
|
||||
*/
|
||||
function social_icons_function( $atts = array() ) {
|
||||
// set up default parameter
|
||||
extract(shortcode_atts(array(
|
||||
'prof' => '0'
|
||||
), $atts));
|
||||
|
||||
if ($prof == '1') {
|
||||
return get_social_icons_prof_str();
|
||||
} else {
|
||||
return get_social_icons_str();
|
||||
}
|
||||
}
|
||||
add_shortcode('social_icons', 'social_icons_function');
|
||||
|
||||
/**
|
||||
* Shortcode to insert single social icon by name
|
||||
* However, social icon MUST be imported in main.js !
|
||||
*/
|
||||
function single_social_icon_function( $atts = array() ) {
|
||||
// set up default parameter
|
||||
extract(shortcode_atts(array(
|
||||
'name' => '0',
|
||||
'class' => 'icon baseline'
|
||||
), $atts));
|
||||
|
||||
if ($name == '0') {
|
||||
return 'social_icon shortcode requires "name" parameter, like "name=mdi-account"';
|
||||
} else {
|
||||
return svg_icon_use($name, $class);
|
||||
}
|
||||
}
|
||||
add_shortcode('social_icon', 'single_social_icon_function');
|
||||
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue