| Server IP : 14.225.204.176 / Your IP : 216.73.216.252 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/langngon.com/wp-content/themes/langngon/lib/ |
Upload File : |
<?php
/*
Make custom shortcode
Dat Nguyen
*/
/***************** Products ****************/
function shortcode_woo_products_container($atts, $content = null, $code) {
global $logotype;
extract(shortcode_atts(array(
'type' => 'grid',
'items_per_column' => 3,
'product' => 'shop'
), $atts));
$logotype = $type;
$output = '';
$output .= '<div id="woo-products" class="woo-content products_block'.$product.'">';
if($type == "slider") {
$output .= '<div id="'.$items_per_column.'_woo_carousel" class="woo-carousel">';
} else {
$output .= '<div id="woo_grid" class="woo-grid cols-'.$items_per_column.'">';
}
$output .= do_shortcode($content).'</div></div>';
return $output;
}
add_shortcode('woo_products', 'shortcode_woo_products_container');
/********************Title***************/
function shortcode_title($atts, $content = null) {
extract(shortcode_atts(array(
'size' => 'big',
'type' => 'simple',
'color' => '',
'align' => '',
'background_color' => '',
'class' => '',
), $atts));
$output = '';
if($type=='fancy')
$output .= '<div class="' . $class . ' dat_'.$type.' shortcode-title products'.$align.'">';
else
$output .= '<div class="' . $class . ' dat_'.$type.' shortcode-title '.$align.'">';
$style = '';
if(!empty($color)) {
$style .= "color:#".$color.";";
}
if(!empty($background_color)){
$style .= "background:#".$background_color."";
}
else{
$style .= "background:#fff";
}
if(in_array($type, array('fancyborder','line'))){
$output .= '<h1 class="'.$type.'-type '.$size.'-title ">'.do_shortcode($content).'</h1>';
}
else{
$output .= '<h1 class="dat_title '.$type.'-type '.$size.'-title " style="'.$style.'">'.do_shortcode($content).'</h1><div class="dat_underline"></div>';
}
$output .= '</div>';
return $output;
}
add_shortcode("title", "shortcode_title");
?>