This topic has 3 replies, 2 voices, and was last updated 9 years, 10 months ago by Anonymous.
Viewing 4 posts - 1 through 4 (of 4 total)
Hi, is there any parameter for adding a css class to section shortcode element? I see there is such an option for ex. button element.
Or is there a fix solution, ex. adding a div with align style option inside the section?
Thanks.
Replace the below code with “custom_css” parameter in hostmev2/framework/shortcode/general in place of section shortcode.
// Section
//--------------------------------------------------------]
if( !function_exists('sys_section')){
function sys_section($atts, $content = null, $code) {
extract(shortcode_atts(array(
'bgcolor' => '',
'image' => '',
'textcolor' => '',
'padding' => '',
'custom_class' => '',
), $atts));
$textcolor = $textcolor ? 'color:'.$textcolor.';':'';
$padding = $padding ? 'padding:'.$padding.';' : '' ;
if( !empty($textcolor) || !empty($padding)){
$section_extras = ' style="'.$padding.$textcolor.'"';
}else{
$section_extras = '';
}
$custom_cssclass = $custom_class;
$bgcolor = $bgcolor ? 'background-color:'.$bgcolor.';':'';
$image = $image ? 'background-image:url('.$image.');':'';
if( !empty($bgcolor) || !empty($image)){
$inner_extras = ' style="'.$bgcolor.$image.'"';
}else{
$inner_extras = '';
}
$out = '<div class="section_row clearfix ' . $custom_cssclass . '" '.$section_extras.'>';
if ( $inner_extras != '' ) {
$out .= '<div class="section_bg" '.$inner_extras.'></div>';
}
if ( $image ) {
$out .= '<div class="section_overlay"></div>';
}
$out .= '<div class="section_inner">'.do_shortcode($content).'</div></div>';
return $out;
}
add_shortcode('section', 'sys_section');
}
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.