<?php /* Template Name: archive vehicle */ get_header(); cde_scripts_styles(); /* include the necessary scripts and styles */ ?> <div class="cde_container"> <?php $style_width = ''; ?> <div class="cde_row"> <?php $order = "&order=ASC"; $cde_select = ""; $cde_ord = ""; if (isset($_POST['cde_select'])) { $order = "&orderby=_cde_" . $_POST['cde_select']; $cde_select = $_POST['cde_select']; } if (isset($_POST['cde_order'])) { $order .= "&order=" . $_POST['cde_order']; $cde_ord = $_POST['cde_order']; } ?> <form method="post" id="order"> <?php
function cde_adv_last($atts) { cde_scripts_styles(); $r = new WP_Query(array('posts_per_page' => 6, 'no_found_rows' => true, 'post_status' => 'publish', 'post_type' => 'vehicle', 'ignore_sticky_posts' => true)); global $cde_mil_abb; global $cde_mon_sym; $cnt = 0; $shrt = ""; if ($r->have_posts()) { while ($r->have_posts()) { $r->the_post(); $shrt .= " <div class=\"cde_col-sm-6 cde_col-md-4 \">"; $shrt .= "<div class=\"cde_thumbnail cde_grid\">"; if (has_post_thumbnail()) { //Get the Thumbnail URL $src_orig = wp_get_attachment_image_src(get_post_thumbnail_id($r->post->ID), 'full', false, ''); $src_thumb = wp_get_attachment_image_src(get_post_thumbnail_id($r->post->ID), 'cde_size', false, ''); $shrt .= "<figure><a href=\"" . $src_orig[0] . "\" rel=\"gallery\" class=\"thumb\"><img src=\"" . $src_thumb[0] . "\" /></a>"; } else { $shrt .= "<div style=\"background:url(" . plugins_url('/car-dealer/images/pattern-1.png') . ");width:" . get_option('cde_thumb_size_w', '303') . "px;height:" . get_option('cde_thumb_size_h', '210') . "px\" title=\"" . __('No Image', 'cde_pgl') . "\"></div>"; } $shrt .= "<figcaption>\n <h4>"; $prefix = '_cde_'; $mileage = get_post_meta(get_the_ID(), $prefix . 'mileage', true); $year = get_post_meta(get_the_ID(), $prefix . 'year', true); $price = get_post_meta(get_the_ID(), $prefix . 'price', true); $shrt .= $cde_mon_sym . " " . $price; $shrt .= "</h4><br /><span>" . sprintf(__('<strong>Year: </strong> %s', "cde_pgl"), $year); $shrt .= "<br>"; $shrt .= sprintf(__('<strong>' . $cde_mil_abb . ' : </strong> %s', "cde_pgl"), $mileage) . "</span><br>\n <a href=\"" . get_the_permalink() . "\">" . __("Take a look", "cde_pgl") . "</a>"; $shrt .= " </figcaption>"; $shrt .= "</figure>"; $shrt .= "<div class=\"caption\">\n <h3> <a href=\"" . get_the_permalink() . "\" title=\"" . get_the_title() . "\">" . get_the_title() . "</a></h3>"; $shrt .= "<p>" . get_the_excerpt() . "</p>"; $shrt .= "</div>"; $shrt .= " </div>"; $shrt .= " </div>"; $cnt += 1; if ($cnt == 3) { $shrt .= "<div class=\"cde_clearfix\"></div>"; $cnt = 0; } } $shrt .= "<div class=\"cde_clearfix\"></div>"; } return $shrt; }