Ejemplo n.º 1
0
 public function pre_get_posts($query)
 {
     global $wpdb, $et_global;
     if (!$query->is_main_query() && !is_search()) {
         return $query;
     }
     $c_str = ET_AdCatergory::slug();
     $l_str = ET_AdLocation::slug();
     $taxs = CE_Fields::get_taxs();
     if (is_array($taxs) && !empty($taxs)) {
         foreach ($taxs as $key => $tax) {
             if (get_query_var($tax['tax_name'])) {
                 $query->query_vars['tax_query'][] = array('taxonomy' => $tax['tax_name'], 'field' => 'slug', 'terms' => get_query_var($tax['tax_name']));
                 $query->query_vars['tax_query']['relation'] = 'AND';
             }
         }
     }
     return $query;
 }
Ejemplo n.º 2
0
    function roll_template_front()
    {
        $html = '<div id="ce_adroll" class="roll-view"><form class="form form-roll-admin" id="frm_roll">
							<div class="form-item">
								<div class="title font-quicksand">
									Content	
								</div>
							</div>							
							<div class="form-item">
								<div class="half alignleft">
									<label>' . __('Select Category', ET_DOMAIN) . '</label>
									<div class="select-style et-button-select">
					        			<select style="z-index: 10; opacity: 0;"  class="change" name="ad_cat">
					        			<option value="">' . __('All Categories', ET_DOMAIN) . '</option>';
        $cats = ET_AdCatergory::get_category_list();
        if ($cats) {
            foreach ($cats as $key => $cat) {
                $html .= '<option value="' . $cat->term_id . '">' . $cat->name . '</option>';
            }
        }
        $html .= '</select>
					        		</div>
					        	</div>
								<div class="half alignright">
									<label>' . __('Select locations', ET_DOMAIN) . '</label>
									<div class="select-style et-button-select">
					        			<select class="change" style="z-index: 10; opacity: 0;" name="ad_location">
						        			<option value="">' . __('All Location', ET_DOMAIN) . '</option>';
        $locations = ET_AdLocation::get_location_list();
        if ($locations) {
            foreach ($locations as $key => $local) {
                $html .= '<option value="' . $local->term_id . '">' . $local->name . '</option>';
            }
        }
        $html .= '</select>		
					        		</div>
								</div>
							</div>
							<div class="form-item">
								<div class="title font-quicksand">
									Display								</div>
							</div>
							<div class="form-item">
								<div class="half alignleft">
								 	<label> Number ads </label>
								 	<input type="text" name="number" class="number" value="5">
								</div>
								<div class="half alignright">
								 	<label> ' . __('Width', ET_DOMAIN) . '</label>
								 	<input type="text"  id="width" value="240">
								</div>
							</div>
							<div class="form-item">
								<div class="half alignleft">
								 	<label> Background Color </label>
								 	<input type="text" name="bgcolor" id="colorpicker" class="bgcolor" value="f5f5f5">
								 	
								</div>
								<div class="half alignright">
								 	<label> Title  </label>
								 	<input type="text" name="title" value="' . __("Ads from Website", ET_DOMAIN) . '">
								</div>
							</div>';
        $id = self::get_page_adroll();
        $link = get_permalink($id);
        $link = add_query_arg(array('adroll_request' => 1), $link);
        $frame = '<iframe scrolling="no" id="frame_preview" style="border:0; overflow:hidden;" src="' . $link . '" width="240px" frameborder="0" height="478px" allowtransparency="true" marginheight="0" marginwidth="0"></iframe>';
        $html .= '<div class="form-item">
								<label> Copy this code and past into your site:</label>
								<textarea class="code-content" cols="10" rows="16">' . $frame . '</textarea>
							</div>


						</form>';
        $html .= '<div class="quick_view alignright">
							<iframe  scrolling="no" id="frame_preview" style="border:0; overflow:hidden;" src="' . $link . '" frameborder="0" width="240px" height="478px" allowtransparency="true" marginheight="0" marginwidth="0"></iframe>
						</div>
						</div>';
        return $html;
    }