Exemplo n.º 1
0
 function thb_contact_map($params = array())
 {
     $latlong = thb_get_option('contact_lat_long');
     $zoom = thb_get_option("contact_zoom");
     $marker = thb_get_option("contact_marker");
     $map_config = array('height' => '500');
     $map_config = thb_array_asum($map_config, $params);
     if ($latlong != '') {
         echo thb_do_shortcode("[thb_map latlong='{$latlong}' zoom='{$zoom}' " . thb_get_attributes($map_config) . " marker='{$marker}']");
     }
 }
Exemplo n.º 2
0
 function thb_text_format($str, $add_paragraphs = false)
 {
     $str = wptexturize(thb_do_shortcode($str));
     if ($add_paragraphs) {
         $str = thb_add_paragraphs($str);
     }
     $str = apply_filters('thb_text_format', $str);
     return $str;
 }
Exemplo n.º 3
0
 /**
  * Displaying the widget
  *
  * @return void
  * @see WP_Widget::widget
  **/
 public function widget($args, $instance)
 {
     if ($this->_showCondition != '' && call_user_func($this->_showCondition) == false) {
         return;
     }
     extract($args);
     // Widget class
     if ($this->_class != '') {
         $before_widget = str_replace("class=\"widget", "class=\"widget " . $this->_class, $before_widget);
     }
     // Data
     $title = apply_filters('widget_title', $instance['title']);
     // Let's display the widget
     echo $before_widget;
     if (!empty($title)) {
         echo $before_title;
         if (!empty($this->_titleLink)) {
             echo '<a href="' . $this->_titleLink . '">';
             echo $title;
             echo '</a>';
         } else {
             echo $title;
         }
         echo $after_title;
     }
     $shortcode = '[' . $this->_shortcode->getName() . ' ' . $this->composeShortcodeAttributes($instance) . ' title="" caller="widget"]';
     echo thb_do_shortcode($shortcode);
     echo $after_widget;
 }
Exemplo n.º 4
0
?>
">
	<ul class="thb-tabs-nav">
		<?php 
$i = 0;
foreach ($tabs as $tab) {
    ?>
			<li>
				<a href="#<?php 
    echo thb_text_slugify($tab[0]);
    ?>
-<?php 
    echo $i;
    ?>
"><?php 
    echo $tab[0];
    ?>
</a>
			</li>
		<?php 
    $i++;
}
?>
	</ul>
	
	<div class="thb-tabs-contents">
		<?php 
echo thb_do_shortcode($content);
?>
	</div>
</div>
    thb_data_attributes($slide_data);
    ?>
>
			<?php 
    if ($slide['type'] == 'image') {
        ?>
				<img src="<?php 
        echo thb_image_get_size($slide['id'], $image_size);
        ?>
" alt="">
			<?php 
    } else {
        ?>
				<?php 
        $attributes = thb_get_attributes(array('url' => $slide['url'], 'class' => 'thb_slideshow_video thb-noFit', 'autoplay' => $slide['autoplay'], 'loop' => $slide['loop']));
        echo thb_do_shortcode('[thb_video ' . $attributes . ']');
        ?>
			<?php 
    }
    ?>

			<?php 
    if ($slide['caption'] != '') {
        ?>
				<div class="caption">
					<?php 
        echo thb_text_format($slide['caption'], true);
        ?>
				</div>
			<?php 
    }
Exemplo n.º 6
0
$class = (array) $class;
if (!in_array($align, $class)) {
    $class[] = $align;
}
if (!empty($icon)) {
    $class[] = 'w-icon';
}
?>

<section class="thb-shortcode thb-box <?php 
echo implode(' ', $class);
?>
">
	<?php 
echo thb_do_shortcode('[thb_icon url="' . $icon . '" align="' . $align . '"]');
?>

	<?php 
if (!empty($title)) {
    ?>
		<h1 class="thb-shortcode-title"><?php 
    echo wptexturize($title);
    ?>
</h1>
	<?php 
}
?>

	<div class="thb-text">
		<?php 
Exemplo n.º 7
0
 function thb_related($post_type = null)
 {
     $id = thb_get_page_ID();
     if (!$post_type) {
         global $post;
         $post_type = $post->post_type;
     }
     $show = thb_get_post_meta($id, $post_type . '_related');
     if ($show != '1') {
         return;
     }
     $shortcode_id = $post_type;
     if ($post_type == 'post') {
         $shortcode_id .= 's';
     }
     $shortcode = '[thb_related_' . $shortcode_id . ' title=""';
     $num = thb_get_post_meta($id, $post_type . '_related_number');
     $thumb = thb_get_post_meta($id, $post_type . '_related_thumb');
     if ($num != '') {
         $shortcode .= ' num="' . $num . '"';
     }
     if ($thumb != '') {
         $shortcode .= ' thumb="' . $thumb . '"';
     }
     $shortcode .= ']';
     echo thb_do_shortcode($shortcode);
 }
Exemplo n.º 8
0
        ?>
" alt="">

					<?php 
        if ($slideshow->slidesImagesClickable()) {
            ?>
						</a>
					<?php 
        }
        ?>

				<?php 
    } else {
        ?>
					<?php 
        echo thb_do_shortcode('[thb_video url="' . $slide['url'] . '" class="thb_slideshow_video" ' . $video_data . ']');
        ?>
				<?php 
    }
    ?>

				<?php 
    if ($slide['caption'] != '') {
        ?>
					<div class="caption">
						<?php 
        echo apply_filters('the_content', $slide['caption']);
        ?>
					</div>
				<?php 
    }
Exemplo n.º 9
0
 function thb_slideshow()
 {
     // $config = thb_config('core/slideshows');
     $page_id = thb_get_page_ID();
     $slideshow_shortcode = thb_get_post_meta($page_id, 'slideshow');
     if (empty($slideshow_shortcode)) {
         return;
     }
     if (thb_text_contains($slideshow_shortcode, 'thb_')) {
         $slideshow_id = thb_get_shortcode_attribute($slideshow_shortcode, 'id');
         $thb_slideshow = new THB_Slideshow($slideshow_id);
         $slideshow_type = $thb_slideshow->getType();
         if (thb_is_page_template(thb_config('core/slideshows/submodules/' . $slideshow_type, 'templates'))) {
             if (!empty($slideshow_shortcode) && trim($slideshow_shortcode) != '') {
                 echo thb_do_shortcode($slideshow_shortcode);
             }
         }
     } else {
         echo thb_do_shortcode($slideshow_shortcode);
     }
 }