function mpcth_icon_divider_shortcode($atts, $content = null) { extract(shortcode_atts(array('title' => '', 'icon' => '', 'color' => '', 'color_active' => '', 'background' => '', 'background_active' => '', 'button_text' => '', 'button_url' => '', 'subheading' => '', 'css_animation' => ''), $atts)); $css_id = 'mpcth_sc_icon_divider_' . mpcth_random_ID(5); $return = '<div id="' . $css_id . '" class="mpcth-sc-icon-divider mpcth-waypoint-trigger' . add_css_animation($css_animation) . '">'; $return .= '<div class="mpcth-sc-icon-divider-line"></div>'; if ($button_url != '') { $return .= '<small class="mpcth-sc-icon-divider-button"><a class="mpcth-sc-icon-divider-button-link" href="' . $button_url . '">' . $button_text . '</a></small>'; } $return .= '<div class="mpcth-sc-icon-divider-wrap">'; $return .= '<div class="mpcth-sc-icon-divider-icon mpcth-sc-icon mpcth-sc-icon-' . $icon . '"></div>'; $return .= '<p class="mpcth-sc-icon-divider-title">' . $title . '</p>'; $return .= '</div>'; if ($subheading != '') { $return .= '<h5 class="mpcth-sc-icon-divider-subheading">' . $subheading . '</h5>'; } $return .= '</div>'; $return .= '<style>'; $return .= '#' . $css_id . '.mpcth-sc-icon-divider .mpcth-sc-icon-divider-line { background: ' . $background . '; }' . PHP_EOL; $return .= '#' . $css_id . '.mpcth-sc-icon-divider .mpcth-sc-icon-divider-icon { color: ' . $color . '; }' . PHP_EOL; $return .= '#' . $css_id . '.mpcth-sc-icon-divider .mpcth-sc-icon-divider-title { color: ' . $color . '; }' . PHP_EOL; $return .= '#' . $css_id . '.mpcth-sc-icon-divider .mpcth-sc-icon-divider-wrap { background: ' . $background . '; border-bottom-color: ' . mpcth_adjust_brightness($background, -20) . ' !important; }' . PHP_EOL; $return .= '#' . $css_id . '.mpcth-sc-icon-divider.mpcth-waypoint-triggered .mpcth-sc-icon-divider-icon { color: ' . $color_active . '; }' . PHP_EOL; $return .= '#' . $css_id . '.mpcth-sc-icon-divider.mpcth-waypoint-triggered .mpcth-sc-icon-divider-title { color: ' . $color_active . '; }' . PHP_EOL; $return .= '#' . $css_id . '.mpcth-sc-icon-divider.mpcth-waypoint-triggered .mpcth-sc-icon-divider-wrap { background: ' . $background_active . '; border-bottom-color: ' . mpcth_adjust_brightness($background_active, -20) . ' !important; }' . PHP_EOL; $return .= '</style>'; $return = parse_shortcode_content($return); return $return; }
function accordion_code($atts, $content = null) { extract(shortcode_atts(array('title' => 'TITLE'), $atts)); $content = parse_shortcode_content($content); return '<section class="accordion-wrap"><article class="accordion-title">' . $title . '</article><article class="accordion-content">' . do_shortcode($content) . '</article></section>'; }
?> <h1><?php if (get_post_meta($brad_page_id, 'brad_page_title', true) != "") { echo get_post_meta($brad_page_id, 'brad_page_title', true); } else { the_title(); } ?> </h1> <?php } ?> <?php if (get_post_meta($brad_page_id, 'brad_titlebar_style', true) == 'style2' && get_post_meta($brad_page_id, 'brad_add_content', true) != '') { echo '<div class="titlebar-subcontent">'; echo parse_shortcode_content(get_post_meta($brad_page_id, 'brad_add_content', true)); echo '</div>'; } ?> <?php if (get_post_meta($brad_page_id, 'brad_titlebar', true) == 'breadcrumb' || get_post_meta($brad_page_id, 'brad_titlebar', true) == 'all') { brad_breadcrumb(); } ?> </div> </div> </div> </section> <?php
function slider_shortcode($atts, $content = '') { extract(shortcode_atts(array('id' => false, 'mode' => 'fade', 'delay' => '8000', 'speed' => '1000', 'frame' => false, 'titles' => false), $atts)); if (!$id) { $id = 'nebula-slider-' . rand(1, 10000); } elseif (strlen($id) > 0 && ctype_digit(substr($id, 0, 1))) { $id = 'nebula-slider-' . $id; } $return = '<div id="' . $id . '" class="nebula-slider-con"><ul class="bxslider ' . $id . '" style="padding-left: 0;">'; $return .= parse_shortcode_content(do_shortcode($content)); $return .= '</ul></div><!--/nebula-shortcode-slider-con-->'; $flags = get_flags($atts); if (!in_array('frame', $flags)) { $return .= '<style> #' . $id . ' .bx-wrapper .bx-viewport {box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none; border: none; background: none;} </style>'; if ($mode == 'fade') { $return .= '<style> #' . $id . ' .bx-wrapper .bx-viewport .nebula-slide {width: auto !important;} </style>'; } } if (in_array('titles', $flags)) { $titles = 'true'; } else { $titles = 'false'; } if (!in_array('controls', $flags)) { $controls = 'false'; $auto = 'true'; } else { $controls = 'true'; if (in_array('delay', $flags)) { $auto = 'true'; } else { $auto = 'false'; } } $return .= '<script> jQuery(window).on("load", function(){ setTimeout(function(){ jQuery(".' . $id . '").bxSlider({ mode: "' . $mode . '", speed: ' . $speed . ', captions: ' . $titles . ', pager: false, auto: ' . $auto . ', pause: ' . $delay . ', autoHover: true, adaptiveHeight: true, useCSS: true, controls: ' . $controls . ' }); }, 1000); }); </script>'; return $return; }
function add_grid_row($atts, $content = null) { // $a = shortcode_atts(); return '<div class="shop-grid row" >' . do_shortcode(parse_shortcode_content($content)) . '</div> <div style="clear:left"></div>'; }