Ejemplo n.º 1
1
 function widget($args, $instance)
 {
     $this->dt_hs_group++;
     $instance = wp_parse_args((array) $instance, self::$default_instance);
     extract($args);
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', $instance['title']);
     $args = array('no_found_rows' => 1, 'post_type' => 'dt_gallery', 'post_status' => 'publish', 'posts_per_page' => -1, 'tax_query' => array(array('taxonomy' => 'dt_gallery_category', 'field' => 'id', 'terms' => $instance['cats'])));
     switch ($instance['select']) {
         case 'only':
             $args['tax_query'][0]['operator'] = 'IN';
             break;
         case 'except':
             $args['tax_query'][0]['operator'] = 'NOT IN';
             break;
         default:
             unset($args['tax_query']);
     }
     add_filter('posts_clauses', 'dt_core_join_left_filter');
     $g_query = new Wp_Query($args);
     remove_filter('posts_clauses', 'dt_core_join_left_filter');
     $g_arr = array();
     if (count($g_query->posts)) {
         foreach ($g_query->posts as $album) {
             if (post_password_required($album->ID)) {
                 continue;
             }
             $g_arr[] = $album->ID;
         }
     }
     dt_storage('where_filter_param', implode(', ', $g_arr));
     $args = array('no_found_rows' => 1, 'posts_per_page' => $instance['show'], 'post_type' => 'attachment', 'post_mime_type' => 'image', 'post_status' => 'inherit', 'orderby' => $instance['orderby'], 'order' => $instance['order']);
     add_filter('posts_where', 'dt_core_parents_where_filter');
     $p_query = new Wp_Query($args);
     remove_filter('posts_where', 'dt_core_parents_where_filter');
     $hs_slideshow_group = 'dt_widget_latphotos_' . intval($this->dt_hs_group);
     echo $before_widget;
     // start
     echo $before_title . $title . $after_title;
     echo '<div class="flickr" data-hs_group="' . $hs_slideshow_group . '">';
     if ($p_query->have_posts()) {
         foreach ($p_query->posts as $photo) {
             if (post_password_required($photo->post_parent)) {
                 continue;
             }
             $caption = $photo->post_excerpt;
             dt_get_thumb_img(array('img_meta' => wp_get_attachment_image_src($photo->ID, 'full'), 'class' => 'alignleft-f', 'title' => esc_attr($caption), 'alt' => get_post_meta($photo->ID, '_wp_attachment_image_alt', true), 'custom' => ' onclick="return hs.expand(this, { slideshowGroup: \'' . $hs_slideshow_group . '\' } )"', 'thumb_opts' => array('w' => 69, 'h' => 69)));
             /*				
                             if ( $caption && 0 )
                                 echo '<div class="highslide-caption">'.$caption.'</div>';
             */
         }
     }
     echo '</div><!-- /.flickr -->';
     echo $after_widget;
 }
Ejemplo n.º 2
0
function breaking_news_ticker($bnt)
{
    $activate = bnt_get_option('activate_deactivate', 'bnt_basics', 'Yes');
    if ($activate !== 'Yes') {
        return $bnt;
    }
    $bnt_q = new Wp_Query(array('post_type' => bnt_get_option('bnt_post_type', 'bnt_basics', 'post'), 'posts_per_page' => bnt_get_option('posts_per_page', 'bnt_basics', '5'), 'orderby' => 'date', 'order' => bnt_get_option('posts_order', 'bnt_basics', 'DESC'), 'category__in' => bnt_get_option('bnt_cat', 'bnt_basics', '')));
    $bnt = '<div class="breaking-news-ticker">';
    $bnt .= '<div class="breaking-news-ticker-title">' . bnt_get_option('main_title', 'bnt_basics', 'Breaking News') . ' <span></span></div>';
    $bnt .= '<div class="bnt-inner"><div id="main-bnt"><ul>';
    while ($bnt_q->have_posts()) {
        $bnt_q->the_post();
        $post_id = get_the_id();
        $length = bnt_get_option('title_length', 'bnt_styles', 55);
        $short_title = the_title('', '', false);
        $short_title = substr($short_title, 0, $length);
        $bnt .= '<li>';
        $bnt .= '<a href="' . get_permalink() . '"> ' . $short_title . ' ...';
        $bnt .= '</a>';
        $date = bnt_get_option('display_date', 'bnt_basics', 'Yes');
        if ($date == 'Yes') {
            $bnt .= '<span class="entry-meta">';
            $bnt .= get_the_time('F j, Y');
            $bnt .= '</span>';
        }
        $bnt .= '</li>';
    }
    $bnt .= '</ul></div></div>';
    //end box
    $controls = bnt_get_option('controls', 'bnt_ticker', 'Yes');
    if ($controls == 'Yes') {
        $bnt .= '<div class="controls">
                <span id="prev-btn">prev</span>
                <span id="next-btn">next</span>
            </div>';
    }
    $bnt .= '</div>';
    //Reset Query Data
    wp_reset_query();
    echo $bnt;
}
Ejemplo n.º 3
0
                        <li class="nxs-placeholder nxs-containshovermenu1 nxs-runtime-autocellsize nxs-one-third nxs-unistyle-footer nxs-unistyled nxs-not-unicontented nxs-widgettype-blog  nxs-column-3-3 nxs-column-lastinrow" style="">
                            <div class="ABC nxs-height100 ">
                                <div class="XYZ ">
                                    <div class="nxs-placeholder-content-wrap nxs-crop ">
                                            <div id="nxs-widget-c1021349230" class="nxs-widget nxs-widget-c1021349230  nxs-blog ">
                                                <div class="nxs-blog-minimal nxs-blogentries nxs-paging-page-0 default">
                                                    <h2 class="nxs-title  nxs-align-left"><?php 
_e('Latest News');
?>
</h2>
                                                    <div class="nxs-clear nxs-filler"></div>
                                                    <ul>
                                                       <?php 
$args = array('posts_per_page' => 5, 'offset' => 0, 'orderby' => 'date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'publish', 'suppress_filters' => true);
$new_post = new Wp_Query($args);
while ($new_post->have_posts()) {
    $new_post->the_post();
    ?>
                                                            <li class="nxs-applylinkvarcolor nxs-default-p nxs-padding-bottom0 nxs-padding-left20">
                                                                <span class="nxs-icon-text  font-icon"></span>
                                                                <a href="<?php 
    the_permalink();
    ?>
"><span><?php 
    the_title();
    ?>
</span></a>
                                                            </li>
                                                        <?php 
}
wp_reset_postdata();
Ejemplo n.º 4
0
function dt_shortcode_photos($atts)
{
    global $wpdb, $post;
    extract(shortcode_atts(array("ppp" => 3, "orderby" => 'Date', "order" => 'DESC', "class" => ' benefits', "except" => '', "only" => ''), $atts));
    // select ID of the albums in selected taxonomy
    $in_select = $list = '';
    if ($except || $only) {
        $list = $only;
        $in_select .= sprintf(' AND %s.term_id', $wpdb->term_taxonomy);
        if ($except) {
            $in_select .= ' NOT';
            $list = $except;
        }
        $in_select .= sprintf(' IN(%s)', $list);
    }
    $query_str = sprintf('SELECT %3$s.ID FROM %1$s 
        JOIN %2$s ON %1$s.term_taxonomy_id = %2$s.term_taxonomy_id 
        JOIN %3$s ON %2$s.object_id = %3$s.ID
        WHERE %1$s.taxonomy = "%4$s" AND %3$s.post_status = "publish"%5$s
        GROUP BY %3$s.ID', $wpdb->term_taxonomy, $wpdb->term_relationships, $wpdb->posts, 'dt_gallery_category', $in_select);
    dt_get_where_filter_params($query_str);
    $args = array('post_type' => 'attachment', 'post_mime_type' => 'image', 'post_status' => 'inherit', 'orderby' => $orderby, 'order' => $order, 'posts_per_page' => $ppp);
    // mpdify query
    add_filter('posts_where', 'dt_posts_parents_where');
    $wp_query = new Wp_Query($args);
    remove_filter('posts_where', 'dt_posts_parents_where');
    remove_filter('the_content', 'prepend_attachment');
    ob_start();
    ?>
    
        <?php 
    if ($wp_query->have_posts()) {
        ?>
        
            <div class="cols benefits highslide-gallery<?php 
        echo esc_attr($class);
        ?>
">
            <?php 
        while ($wp_query->have_posts()) {
            $wp_query->the_post();
            get_template_part('dt_photos', 'content');
        }
        ?>
            
            </div>
            
        <?php 
    }
    ?>

    <?php 
    $output = ob_get_clean();
    add_filter('the_content', 'prepend_attachment');
    wp_reset_query();
    return $output;
}
Ejemplo n.º 5
0
if (isset($_GET['cruise_destination']) && $_GET['cruise_destination'] != '') {
    $args[] = array('key' => 'Nume destinatie', 'value' => $_GET['cruise_destination']);
}
if (isset($_GET['cruise_line']) && $_GET['cruise_line'] != '') {
    $args[] = array('key' => 'Nume linie', 'value' => $_GET['cruise_line']);
}
if (isset($_GET['cruise_ship']) && $_GET['cruise_ship'] != '') {
    $args[] = array('key' => 'Nume vas', 'value' => $_GET['cruise_ship']);
}
if (isset($_GET['cruise_port']) && $_GET['cruise_port'] != '') {
    $args[] = array('key' => 'Nume port', 'value' => $_GET['cruise_port']);
}
$dest_query = new Wp_Query(array('post_type' => 'cruise', 'meta_query' => $args, 'paged' => get_query_var('paged')));
?>
				<?php 
if ($dest_query->have_posts()) {
    ?>
					<ul class="listing">
						<?php 
    while ($dest_query->have_posts()) {
        $dest_query->the_post();
        ?>
							<li class="item">
								<a class="thumbnail" href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
">
									<?php 
Ejemplo n.º 6
0
/**
 * Map Shortcode
 * @since 1.0
**/
function epl_advanced_map($atts)
{
    global $property, $post;
    if (is_null($post)) {
        return;
    }
    extract(shortcode_atts(array('post_type' => epl_all_post_types(), 'limit' => '30', 'coords' => '', 'display' => 'card', 'zoom' => '17', 'height' => '', 'cluster' => false, 'property_status' => '', 'home_open' => false, 'location' => ''), $atts));
    if (!is_array($post_type)) {
        if (!empty($post_type)) {
            $post_type = explode(",", $post_type);
        }
    }
    $args = array('post_type' => $post_type, 'posts_per_page' => $limit, 'paged' => '1', 'epl_nopaging' => 'true', 'meta_query' => array(array('key' => 'property_address_coordinates', 'value' => '', 'compare' => '!=')));
    if (!empty($property_status)) {
        if (!is_array($property_status)) {
            if (!empty($property_status)) {
                $property_status = explode(",", $property_status);
                $property_status = array_filter($property_status);
            }
        }
        if (($key = array_search('withdrawn', $property_status)) !== false) {
            unset($property_status[$key]);
        }
        if (($key = array_search('offmarket', $property_status)) !== false) {
            unset($property_status[$key]);
        }
        $args['meta_query'][] = array('key' => 'property_status', 'value' => $property_status, 'compare' => 'IN');
    }
    if (!empty($home_open)) {
        if (true == $home_open) {
            $args['meta_query'][] = array('key' => 'property_inspection_times', 'value' => '', 'compare' => '!=');
        }
    }
    // if user has specified location , use that
    if (!empty($location)) {
        if (!is_array($location)) {
            $location = explode(",", $location);
            $location = array_map('trim', $location);
            $args['tax_query'][] = array('taxonomy' => 'location', 'field' => 'slug', 'terms' => $location);
        }
    }
    // if user has not specified location fetch property's location
    if (!is_null($property)) {
        if (empty($location) && !is_archive() && !in_array($property->post_type, apply_filters('epl_am_skip_location_filter', array('epl_office')))) {
            $location = wp_get_object_terms($property->post->ID, 'location', array('fields' => 'slugs'));
            $args['tax_query'][] = array('taxonomy' => 'location', 'field' => 'slug', 'terms' => $location);
        }
    }
    $results = new Wp_Query($args);
    global $property, $epl_settings;
    $cluster = $cluster == 'true' || $cluster == 'on' ? 'true' : 'false';
    $infobox_class = isset($epl_settings['epl_am_infobox_style']) ? $epl_settings['epl_am_infobox_style'] : 'rounded';
    $return = '';
    $return .= "<div id='epl-advanced-map' class='epl-am-infobox-{$infobox_class}'>";
    $return .= '
				<input type="hidden" name="slider[zoom]" value="' . $zoom . '" />
				<input type="hidden" name="slider[height]" value="' . $height . '" />
				<input type="hidden" name="slider[cluster]" value="' . $cluster . '" />
				<input type="hidden" name="slider[display]" value="' . $display . '" />
			
				<div  class="slider-map"></div>
				<div  class="slider-map-zoom-in"></div>	
				<div  class="slider-map-zoom-out"></div>';
    if ($display == 'slider') {
        $return .= '
						<div class="slider-map-featured">
							<div class="slider-map-featured-left" ></div>
							<div  class="slider-map-featured-right"></div>
		
							<ul>';
        if ($results->have_posts()) {
            while ($results->have_posts()) {
                $results->the_post();
                if (has_post_thumbnail()) {
                    $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'medium');
                    $epl_am_prop_image = $image[0];
                } else {
                    $epl_am_prop_image = EPL_AM_PLUGIN_URL_IMAGES . 'no-image.jpg';
                }
                $return .= '
										<li id="marker_featured_' . get_the_ID() . '" class="marker-featured-slide ">
											<img src="' . $epl_am_prop_image . '" alt="' . get_the_title() . '" title="' . get_the_title() . '" />
											<span class="slider-title">' . get_the_title() . '</span>
											<p>' . get_the_excerpt() . '</p>';
                if (!in_array(get_post_type(), apply_filters('epl_am_no_price', array('location_profile')))) {
                    $return .= '
														<div class="slider-price">
															<span class="page-price">';
                    $return .= '<span class="price_class">' . epl_get_property_price() . '</span>';
                    //$return .= '<span class="price_sticker">'.epl_get_price_sticker().'</span>';
                    $return .= '
															</span>
														</div>
													';
                }
                $return .= '
											<div class="property-info">';
                //$return .= '<div class="epl-adv-popup-meta">'.epl_get_property_icons().'</div>';
                $return .= '<a href="' . get_permalink() . '" title="' . get_the_title() . '" class="view">View Property</a>
											</div>
										</li>
									';
            }
        }
        wp_reset_postdata();
        $return .= '
							</ul>
						</div>
						<div class="clear"></div>
					';
    } else {
        if ($display == 'popup') {
            $return .= '
						<div class="bpopup" id="bpopup-epl-am">
							<span class="b-close"><span>X</span></span>
							<div class="bpopup-inner" id="bpopup-inner"><!-- Ajax Loaded Data --></div>
						</div>
					';
        } else {
        }
    }
    $return .= '
			</div>

			<script type="text/javascript">
				jQuery(document).ready(function() { ';
    if ($results->have_posts()) {
        $post_counter = 1;
        while ($results->have_posts()) {
            $results->the_post();
            $property_address_coordinates = $property->get_property_meta('property_address_coordinates');
            $property_address_coordinates = explode(',', $property_address_coordinates);
            $epl_am_lat = trim($property_address_coordinates[0]);
            $epl_am_long = trim($property_address_coordinates[1]);
            if ($post_counter == 1) {
                $center_lat = $epl_am_lat;
                $center_long = $epl_am_long;
            }
            if (has_post_thumbnail()) {
                $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'medium');
                $epl_am_prop_image = $image[0];
            } else {
                $epl_am_prop_image = EPL_AM_PLUGIN_URL_IMAGES . 'no-image.jpg';
            }
            $image_pin = epl_am_get_property_image($property);
            $content = epl_get_property_icons();
            $price_content = '';
            $price_content .= '
								<div class="slider-price">
									<span class="page-price">';
            $price_content .= '<span class="price_class">' . epl_get_property_price() . '</span>';
            //$price_content .= '<span class="price_sticker">'.epl_get_price_sticker().'</span>';
            $price_content .= '
									</span>
								</div>
							';
            $content = '<div class="property-info"><span class="property_address_suburb">' . epl_property_get_the_full_address() . '</span>' . $price_content . '<div class="epl-adv-popup-meta">' . $content . '</div></div>';
            $content = preg_replace('~[\\r\\n]+~', '', $content);
            $return .= '
								myGmap.addFeaturedMarker(\'' . get_the_ID() . '\', \'' . addslashes(epl_property_get_the_full_address()) . '\', \'' . $epl_am_lat . '\', \'' . $epl_am_long . '\', \'' . $image_pin . '\', \'' . get_permalink() . '\', \'' . $epl_am_prop_image . '\', \'' . addslashes(get_the_title()) . '\', \'' . addslashes($content) . '\');
							';
            $post_counter++;
        }
    }
    wp_reset_postdata();
    if ($coords != '') {
        $center_coordinates = explode(',', $coords);
        $center_lat = trim($center_coordinates[0]);
        $center_long = trim($center_coordinates[1]);
    } else {
        if (!is_null($property)) {
            $center_coordinates = $property->get_property_meta('property_address_coordinates');
            $center_coordinates = explode(',', $center_coordinates);
            $center_lat = trim($center_coordinates[0]);
            $center_long = trim($center_coordinates[1]);
        }
    }
    $return .= '
					set_markers( "' . EPL_AM_PLUGIN_URL_IMAGES . '" );
					var latlng = new google.maps.LatLng(' . trim($center_lat) . ', ' . trim($center_long) . ');
					myGmap.gmap3("get").setCenter(latlng);
					
				});
			</script>
		';
    return $return;
}
function breaking_news_ticker_shortcode($atts, $news)
{
    $activate = bnt_get_option('activate_deactivate', 'bnt_basics', 'Yes');
    if ($activate !== 'Yes') {
        return $news;
    }
    extract(shortcode_atts(array('post_type' => 'post', 'id' => 1, 'title' => 'Breaking News', 'show_posts' => 5, 'bnt_cat' => '', 'orderby' => 'date', 'order' => 'DESC', 'bgcolor' => '333333', 'tbgcolor' => '222222', 'border_width' => '0', 'border_color' => '222222', 'date_color' => 'b23737', 'controls_btn_bg' => 'dd3333', 'border_style' => 'solid', 'border_radius' => '0', 't_length' => '35', 'bnt_speed' => 500, 'bnt_direction' => 'up', 'bnt_interval' => 3000, 'bnt_height' => 'auto', 'bnt_buttons' => 'on', 'show_date' => 'show'), $atts, 'newsticker'));
    $breaking_nt_query = new Wp_Query(array('post_type' => $post_type, 'posts_per_page' => $show_posts, 'category__in' => $bnt_cat, 'orderby' => $orderby, 'order' => $order));
    $news = '<div class="bnt-shortcode" style="background-color:#' . $bgcolor . '; border-width:' . $border_width . 'px; border-color:#' . $border_color . '; border-style:' . $border_style . '; border-radius:' . $border_radius . 'px;">';
    $news .= '<div class="bnt-title" style="background-color: #' . $tbgcolor . ';">' . $title . '';
    $news .= '<span style=" border-color: transparent transparent transparent #' . $tbgcolor . ';"></span>';
    $news .= '</div>';
    // end .bnt-title
    $news .= '<div class="bnt-inner">';
    $news .= '<div id="bnt-' . $id . '">';
    $news .= '<ul>';
    while ($breaking_nt_query->have_posts()) {
        $breaking_nt_query->the_post();
        $post_id = get_the_id();
        $length = $t_length;
        $short_title = get_the_title('', '', false);
        $short_title = substr($short_title, 0, $length);
        $news .= '<li><a href="' . get_permalink() . '">' . $short_title . ' ...</a>';
        if ($show_date == 'show') {
            $news .= '<span style="color:#' . $date_color . ';" class="bnt-entry-meta">' . get_the_time('F j, Y') . '</span>';
        }
        $news .= '</li>';
    }
    $news .= '</ul>';
    // end ul
    $news .= '</div>';
    // end #bnt
    $news .= '</div>';
    // end .bnt-inner
    if ($bnt_buttons == 'on') {
        $news .= '<div class="shotcode-controls">';
        $news .= '<span style="background-color: #' . $controls_btn_bg . ';" id="prev-button-' . $id . '">prev</span>
                <span style="background-color: #' . $controls_btn_bg . ';" id="next-button-' . $id . '">next</span>';
        $news .= '</div>';
        // end Controls
    }
    $news .= '</div>';
    // end .bnt-shortcode
    $sq = "'";
    $news .= '<script>';
    $news .= 'jQuery(document).ready(function(){
            jQuery("#bnt-' . $id . '").easyTicker({
                direction: ' . $sq . $bnt_direction . $sq . ',
                speed: ' . $bnt_speed . ',
                interval:' . $bnt_interval . ',
                height: ' . $sq . $bnt_height . $sq . ',
                visible: 1, 
                controls: {
                    down:"#next-button-' . $id . '",
                    up:"#prev-button-' . $id . '"
                }
            });
        });
    ';
    $news .= '</script>';
    //Reset Query Data
    wp_reset_query();
    return $news;
}
Ejemplo n.º 8
0
function dt_shortcode_benefits($atts)
{
    global $post;
    $temp = clone $post;
    extract(shortcode_atts(array("ppp" => 4, "title" => '', "orderby" => 'Date', "order" => 'DESC', "class" => '', "except" => '', "only" => '', "column" => 'half'), $atts));
    if ('full-width_three' == $column) {
        $column = str_replace('_three', ' third', $column);
    }
    if ('full-width_fourth' == $column) {
        $column = str_replace('_fourth', ' fourth', $column);
    }
    $output = '';
    $args = array('no_found_rows' => 1, 'post_type' => 'dt_benefits', 'post_status' => 'publish', 'orderby' => $orderby, 'order' => $order);
    if ($except || $only) {
        $cats = array_map('trim', explode(',', $except ? $except : $only));
        $args['tax_query'] = array(array('taxonomy' => 'dt_benefits_category', 'field' => 'id', 'terms' => $cats, 'operator' => 'IN'));
        if ($except) {
            $args['tax_query'][0]['oprerator'] = 'NOT IN';
        }
    }
    if ($ppp) {
        $args['posts_per_page'] = $ppp;
    }
    $query = new Wp_Query($args);
    // caching!
    if ($query->have_posts()) {
        $images = array();
        foreach ($query->posts as $p) {
            $post_meta = get_post_meta($p->ID, '_dt_benefits_options', true);
            if (!empty($post_meta['retina_image_id'])) {
                $images[] = intval($post_meta['retina_image_id']);
            }
            if (has_post_thumbnail($p->ID)) {
                $images[] = get_post_thumbnail_id($p->ID);
            }
        }
        if ($images) {
            $i_query = new WP_Query(array('no_found_rows' => 1, 'posts_per_page' => -1, 'post_type' => 'attachment', 'post_status' => 'inherit', 'post__in' => $images));
        }
    }
    if ($query->have_posts()) {
        $output .= '<div class="' . $column . $class . '">' . "\n";
        if ($title) {
            $output .= '<h2>' . $title . '</h2>' . "\n";
        }
        $output .= '<div class="text-content">' . "\n";
        while ($query->have_posts()) {
            $query->the_post();
            $output .= '<div class="text-inline">' . "\n";
            $post_data = get_post_meta(get_the_ID(), '_dt_benefits_options', true);
            $thmb_id = get_post_thumbnail_id(get_the_ID());
            $alt = esc_attr(get_the_title());
            // fill array with images
            $images = array();
            $images['normal'] = has_post_thumbnail(get_the_ID()) ? dt_get_uploaded_logo(array('', $thmb_id)) : null;
            $images['retina'] = !empty($post_data['retina_image_id']) ? dt_get_uploaded_logo(array('', intval($post_data['retina_image_id'])), 'retina') : null;
            // calculate default image
            $default_img = null;
            foreach ($images as $image) {
                if ($image) {
                    $default_img = $image;
                    break;
                }
            }
            // if there are any image - output it
            $image = '';
            if ($default_img) {
                $image = dt_get_retina_sensible_image($images['normal'], $images['retina'], $default_img, 'class="do-ico" alt="' . $alt . '"');
            }
            $output .= sprintf('<p class="head">%2$s</p><p>%1$s%3$s</p>' . "\n", $image, get_the_title(), get_the_content());
            $output .= '</div>' . "\n";
        }
        $output .= '</div>' . "\n";
        $output .= '</div>' . "\n";
    }
    $post = $temp;
    return $output;
}
Ejemplo n.º 9
0
 function st_location_list_tour_func($attr)
 {
     $data = shortcode_atts(array('st_location_style' => "", 'st_location_num' => "", 'st_location_orderby' => "", 'st_location_order' => ""), $attr, 'st_location_list_car');
     extract($data);
     $return;
     $query = array('post_type' => 'st_tours', 'meta_key' => 'id_location', 'meta_value' => get_the_ID(), 'posts_per_page' => $st_location_num, 'order' => $st_location_order, 'orderby' => $st_location_orderby, 'post_status' => 'publish');
     if (STInput::request('style')) {
         $st_location_style = STInput::request('style');
     }
     if ($st_location_style == 'list') {
         $return .= "<ul class='booking-list loop-tours style_list loop-tours-location'>";
     } else {
         $return .= '<div class="row row-wrap grid-tour-location">';
     }
     $query = new Wp_Query($query);
     while ($query->have_posts()) {
         $query->the_post();
         if ($st_location_style == 'list') {
             $return .= st()->load_template('tours/elements/loop/loop-1', null, array('tour_id' => get_the_ID()));
         } else {
             $return .= st()->load_template('tours/elements/loop/loop-2', null, array('tour_id' => get_the_ID()));
         }
     }
     wp_reset_query();
     if ($st_location_style == 'list') {
         $return .= "</ul>";
     } else {
         $return .= "<div>";
     }
     $link = STLocation::get_total_text_footer('st_tours');
     $return .= balancetags($link);
     return $return;
 }
Ejemplo n.º 10
0
function delete_unwanted_range_values_callbk($unwanted_fields, $check)
{
    if ($check !== 'range_change') {
        return;
    }
    $term_id = key($unwanted_fields);
    $args = array('post_type' => 'soya_feature', 'tax_query' => array(array('taxonomy' => 'soya-range', 'terms' => $term_id)));
    $query = new Wp_Query($args);
    if ($query->have_posts()) {
        //loop posts of the term
        while ($query->have_posts()) {
            $query->the_post();
            //iterate through the meta keys
            foreach ($unwanted_fields[$term_id] as $meta_key) {
                if (soya_meta_key_exists($meta_key, get_the_ID())) {
                    delete_post_meta(get_the_ID(), $meta_key);
                }
            }
        }
    }
    //   foreach ($unwanted_fields[$term_id] as $range_value){
    //   }
    //  $_SESSION['unwanted_term_meta_fields'] = $unwanted_fields;
}
Ejemplo n.º 11
0
 function st_location_list_holiday_func($attr)
 {
     $data = shortcode_atts(array('st_location_style' => "", 'st_location_num' => "", 'st_location_orderby' => "", 'st_location_order' => ""), $attr, 'st_location_list_car');
     extract($data);
     $return = '';
     $_SESSION['el_post_type'] = 'st_holidays';
     $st_location = new st_location();
     add_filter('posts_where', array($st_location, '_get_query_where'));
     add_filter('posts_join', array($st_location, '_get_query_join'));
     $query = array('post_type' => 'st_holidays', 'posts_per_page' => $st_location_num, 'order' => $st_location_order, 'orderby' => $st_location_orderby, 'post_status' => 'publish');
     if (STInput::request('style')) {
         $st_location_style = STInput::request('style');
     }
     if ($st_location_style == 'list') {
         $return .= "<ul class='booking-list loop-holidays style_list loop-holidays-location'>";
     } else {
         $return .= '<div class="row row-wrap grid-holiday-location">';
     }
     $query = new Wp_Query($query);
     unset($_SESSION['el_post_type']);
     remove_filter('posts_where', array($st_location, '_get_query_where'));
     remove_filter('posts_join', array($st_location, '_get_query_join'));
     while ($query->have_posts()) {
         $query->the_post();
         if ($st_location_style == 'list') {
             $return .= st()->load_template('holidays/elements/loop/loop-1', null, array('holiday_id' => get_the_ID()));
         } else {
             $return .= st()->load_template('holidays/elements/loop/loop-2', null, array('holiday_id' => get_the_ID()));
         }
     }
     wp_reset_query();
     if ($st_location_style == 'list') {
         $return .= "</ul>";
     } else {
         $return .= "</div>";
     }
     return $return;
 }
Ejemplo n.º 12
0
        <?php 
get_template_part('partials/header/branding');
?>
        
        <?php 
get_template_part('partials/header/nav');
?>
        <div id="header-rollover" data-open="0">
			<div id="rollover-wrapper">
				<div id="rollover-info">
					<?php 
$query = new Wp_Query(array('post_type' => 'page', 'post__in' => array(29, 31, 33)));
$k = 0;
// The Loop
if ($query->have_posts()) {
    while ($query->have_posts()) {
        $query->the_post();
        echo '<div class="rollover-item ';
        if ($k == 0) {
            echo 'first';
            $k = 1;
        }
        echo '">';
        echo '<p class="rollover-title-text">' . get_the_title() . '</p>';
        echo '<p class="rollover-regular-text">' . get_the_content() . '</p>';
        echo '</div>';
    }
}
/* Restore original Post Data */
wp_reset_postdata();
Ejemplo n.º 13
0
<?php

$args = array('post_type' => 'post', 'category_name' => 'hero_press');
$press = new Wp_Query($args);
?>
<div id="mediaSlider">
	<?php 
//Loop Commences
if ($press->have_posts()) {
    while ($press->have_posts()) {
        $press->the_post();
        ?>
	<div class="item">
		<?php 
        the_content();
        ?>
	</div>
	<?php 
    }
    ?>
</div>
<?php 
} else {
    ?>
<div class="alert alert-danger" role="alert">
	<p>Media Slider Placeholder</p>
</div>
<?php 
}
wp_reset_postdata();
?>
Ejemplo n.º 14
0
            $meta = get_post_meta(get_the_ID());
            $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
            $output1 .= '<li><a href="#"><img src="' . $thumb[0] . '" alt=""></a></li>';
            $output2 .= '<li><img src="' . $thumb[0] . '" alt="" /></li>';
        }
    }
    $output1 = $output1 . '</ul></div>';
    $output2 = $output2 . '</ul></div>';
    $output = $output1 . $output2;
    return $output;
});
add_shortcode("testamonial", function () {
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $loop = new Wp_Query(array('post_type' => 'home_page', 'posts_per_page' => 10, 'paged' => $paged, 'offset' => ($paged - 1) * 10, 'tax_query' => array(array('taxonomy' => 'genere', 'field' => 'slug', 'terms' => 'testimonials'))));
    $output = '<section id="content"><div class="container"><div id="main"><div class="items-container isotope row image-box style9">';
    if ($loop->have_posts()) {
        while ($loop->have_posts()) {
            $loop->the_post();
            $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
            $output .= '<div class="iso-item col-xs-12 col-sm-6 filter-all filter-island filter-beach">
                            <article class="box">
                                <figure>
                                    <a class="" title="" href="javascript:void(0)"><img width="570" height="250" alt="' . the_title('', '', false) . '" src="' . $thumb[0] . '"></a>
                                </figure>
                                <div class="details">
                                    <h4 class="box-title">' . the_title('', '', false) . '</h4>
                                </div>
                            </article>
                        </div>';
            $output .= the_content();
        }