The code below will add an image to the list and detail page, that will link to a Car Proof report. If no report is found the ‘customer’ will be redirected to the page of your choice (see notes). See screen shot below for what it will look like.
Notes:
-This is written for the Armadillo theme, it will work with other themes but the code (ids) will have to be changed.
-When no report is found, ‘customer’ will be redirected to url: http://www.YOURDOMAIN.com/car-proof/, please change url in both place to a page on your site. (include a form for lead submission.)
-Replace “/wp-content/uploads/2013/05/logo_carproof.png” with and img of your choice. (Feel free to use the above image.)
-Please add code to Scripts n Styles or similar, in the ‘body’ section.
/****Runs Carproof****/
if ( jQuery('#armadillo-listing').length ) {
jQuery('.armadillo-item').each( function() {
raw_vin = jQuery(this).find('.armadillo-vin').text();
vin = jQuery.trim(raw_vin.replace(/vin: /i,''));
a_style = 'display:block; width: auto; height:auto; border:none; background: none; float:left; clear: both; margin-top:-35px;margin-left:160px';
img_element = '';
jQuery(this).find('.armadillo-price').append(img_element);
});
}
if ( jQuery('#armadillo-detail').length ) {
var vin;
jQuery('.armadillo-vehicle-information div').each( function () {
if ( jQuery(this).text().match(/vin:/i) != null) {
raw_vin = jQuery(this).text();
vin = jQuery.trim(raw_vin.replace(/vin:/i, ''));
}
});
a_style = 'display:block; width: auto; height:auto; border:none; background: none; margin: 0 3% 3%;';
img_element = '';
jQuery('.armadillo-vehicle-information').append(img_element);
}