Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.21 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for displaying Category pages.
  4. *
  5. * Learn more: http://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package WordPress
  8. * @subpackage FlatAds
  9. * @since FlatAds 1.0
  10. */
  11.  
  12. get_header();
  13.  
  14. global $redux_demo, $maximRange;
  15. $max_range = $redux_demo['max_range'];
  16. if(!empty($max_range)) {
  17. $maximRange = $max_range;
  18. } else {
  19. $maximRange = 1000;
  20. }
  21.  
  22.  
  23. ?>
  24.  
  25.  
  26.  
  27.  
  28. <section id="category-featured-ads-title">
  29.  
  30. <div class="container">
  31.  
  32. <?php
  33.  
  34. $cat_id = get_cat_ID(single_cat_title('', false));
  35.  
  36. $this_category = get_category($cat);
  37.  
  38. if ($this_category->category_parent == 0) {
  39.  
  40. $tag = $cat_id;
  41.  
  42. $tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
  43. if (isset($tag_extra_fields[$tag])) {
  44. $category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
  45. $category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
  46. }
  47.  
  48. } else {
  49.  
  50. $parent_category = get_category($this_category->category_parent);
  51. $getParentCatId = $parent_category->cat_ID;
  52.  
  53. $tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
  54. if (isset($tag_extra_fields[$getParentCatId])) {
  55. $category_icon_code = $tag_extra_fields[$getParentCatId]['category_icon_code'];
  56. $category_icon_color = $tag_extra_fields[$getParentCatId]['category_icon_color'];
  57. }
  58.  
  59. }
  60.  
  61. if(!empty($category_icon_code)) {
  62.  
  63. ?>
  64.  
  65. <div class="category-icon-box" style="background-color: <?php echo $category_icon_color; ?>;"><?php $category_icon = stripslashes($category_icon_code); echo $category_icon; ?></div>
  66.  
  67. <?php } ?>
  68.  
  69. <?php
  70.  
  71. $cat_id = get_cat_ID(single_cat_title('', false));
  72.  
  73. $cat_parent_ID = isset( $cat_id->category_parent ) ? $cat_id->category_parent : '';
  74.  
  75. if ($cat_parent_ID == 0) {
  76.  
  77. $tag = $cat_id;
  78.  
  79. } else {
  80.  
  81. $tag = $cat_parent_ID;
  82.  
  83. }
  84.  
  85. $category = get_category($tag);
  86. $count = $category->category_count;
  87.  
  88. $catName = get_cat_name( $tag );
  89.  
  90. echo '<h2>';
  91. echo $catName;
  92. echo '</h2>';
  93.  
  94. ?>
  95.  
  96.  
  97.  
  98. </div>
  99.  
  100. </section>
  101.  
  102. <section id="big-map">
  103.  
  104. <div id="flatads-main-map"></div>
  105.  
  106.  
  107.  
  108. <?php
  109.  
  110. global $redux_demo;
  111.  
  112. $header_version = $redux_demo['header-version'];
  113.  
  114. ?>
  115.  
  116. <?php if($header_version == 1) { ?>
  117.  
  118. <div id="advanced-search-widget">
  119.  
  120. <div class="container">
  121.  
  122. <div class="advanced-search-widget-content">
  123.  
  124. <div class="advanced-search-title">
  125.  
  126. <?php _e( 'Search around my position', 'agrg' ); ?>
  127.  
  128. </div>
  129.  
  130. <div class="advanced-search-slider">
  131.  
  132. <div class="geo-location-button">
  133.  
  134. <div class="geo-location-switch off"><i class="fa fa-location-arrow"></i></div>
  135.  
  136. </div>
  137.  
  138. <div id="advance-search-slider" class="value-slider ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" aria-disabled="false">
  139. <a class="ui-slider-handle ui-state-default ui-corner-all" href="#">
  140. <span class="range-pin">
  141. <input type="text" name="geo-radius" id="geo-radius" value="100" data-default-value="100">
  142. </span>
  143. </a>
  144. </div>
  145.  
  146. </div>
  147.  
  148. </div>
  149.  
  150. </div>
  151.  
  152. </div>
  153.  
  154. <?php } elseif($header_version == 2) { ?>
  155.  
  156. <div id="advanced-search-widget-version2">
  157.  
  158. <div class="container">
  159.  
  160. <div class="advanced-search-widget-content">
  161.  
  162. <form action="<?php echo home_url(); ?>" method="get" id="views-exposed-form-search-view-other-ads-page" accept-charset="UTF-8">
  163.  
  164. <div id="edit-search-api-views-fulltext-wrapper" class="views-exposed-widget views-widget-filter-search_api_views_fulltext">
  165. <div class="views-widget">
  166. <div class="control-group form-type-textfield form-item-search-api-views-fulltext form-item">
  167. <div class="controls">
  168. <input placeholder="Enter keyword..." type="text" id="edit-search-api-views-fulltext" name="s" value="" size="30" maxlength="128" class="form-text">
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173.  
  174. <div id="edit-ad-location-wrapper" class="views-exposed-widget views-widget-filter-field_ad_location">
  175. <div class="views-widget">
  176. <div class="control-group form-type-select form-item-ad-location form-item">
  177. <div class="controls">
  178. <select id="edit-ad-location" name="post_location" class="form-select" style="display: none;">
  179. <option value="All" selected="selected">Location...</option>
  180.  
  181. <?php
  182.  
  183. $args_location = array( 'posts_per_page' => -1 );
  184. $lastposts = get_posts( $args_location );
  185.  
  186. $all_post_location = array();
  187. foreach( $lastposts as $post ) {
  188. $all_post_location[] = get_post_meta( $post->ID, 'post_location', true );
  189. }
  190.  
  191. $directors = array_unique($all_post_location);
  192. foreach ($directors as $director) { ?>
  193. <option value="<?php echo $director; ?>"><?php echo $director; ?></option>
  194. <?php }
  195.  
  196. ?>
  197.  
  198. <?php wp_reset_query(); ?>
  199.  
  200. </select>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205.  
  206. <div id="edit-field-category-wrapper" class="views-exposed-widget views-widget-filter-field_category">
  207. <div class="views-widget">
  208. <div class="control-group form-type-select form-item-field-category form-item">
  209. <div class="controls">
  210. <select id="edit-field-category" name="category_name" class="form-select" style="display: none;">
  211.  
  212. <option value="All" selected="selected">Category...</option>
  213. <?php
  214. $args = array(
  215. 'hierarchical' => '0',
  216. 'hide_empty' => '0'
  217. );
  218. $categories = get_categories($args);
  219. foreach ($categories as $cat) {
  220. if ($cat->category_parent == 0) {
  221. $catID = $cat->cat_ID;
  222. ?>
  223. <option value="<?php echo $cat->cat_name; ?>"><?php echo $cat->cat_name; ?></option>
  224.  
  225. <?php
  226. $args2 = array(
  227. 'hide_empty' => '0',
  228. 'parent' => $catID
  229. );
  230. $categories = get_categories($args2);
  231. foreach ($categories as $cat) { ?>
  232. <option value="<?php echo $cat->slug; ?>">- <?php echo $cat->cat_name; ?></option>
  233. <?php } ?>
  234.  
  235. <?php } else { ?>
  236. <?php }
  237. } ?>
  238.  
  239. </select>
  240. </div>
  241. </div>
  242. </div>
  243. </div>
  244.  
  245. <div class="advanced-search-slider">
  246.  
  247. <div class="geo-location-button">
  248.  
  249. <div class="geo-location-switch off"><i class="fa fa-location-arrow"></i></div>
  250.  
  251. </div>
  252.  
  253. <div id="advance-search-slider" class="value-slider ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" aria-disabled="false">
  254. <a class="ui-slider-handle ui-state-default ui-corner-all" href="#">
  255. <span class="range-pin">
  256. <input type="text" name="geo-radius" id="geo-radius" value="100" data-default-value="100">
  257. </span>
  258. </a>
  259. </div>
  260.  
  261. </div>
  262.  
  263.  
  264. <input type="text" name="geo-location" id="geo-location" value="off" data-default-value="off">
  265.  
  266. <input type="text" name="geo-radius-search" id="geo-radius-search" value="500" data-default-value="500">
  267.  
  268. <input type="text" name="geo-search-lat" id="geo-search-lat" value="0" data-default-value="0">
  269.  
  270. <input type="text" name="geo-search-lng" id="geo-search-lng" value="0" data-default-value="0">
  271.  
  272.  
  273. <div class="views-exposed-widget views-submit-button">
  274. <button class="btn btn-primary form-submit" id="edit-submit-search-view" name="" value="Search" type="submit"><?php printf( __( 'Search', 'agrg' )); ?></button>
  275. </div>
  276.  
  277. </form>
  278.  
  279. </div>
  280.  
  281. </div>
  282.  
  283. </div>
  284.  
  285. <?php } ?>
  286.  
  287. </section>
  288.  
  289. <?php
  290.  
  291. global $redux_demo;
  292.  
  293. $featured_ads_option = $redux_demo['featured-options-on'];
  294.  
  295. ?>
  296.  
  297. <?php if($featured_ads_option == 1) { ?>
  298.  
  299. <section id="featured-ads-category">
  300.  
  301. <div class="container">
  302.  
  303. <h3><?php _e( 'Check out our Premium Featured Ads', 'agrg' ); ?></h3>
  304.  
  305. <div id="tabs" class="full">
  306.  
  307. <?php $cat_id = get_cat_ID(single_cat_title('', false)); ?>
  308.  
  309. <ul class="tabs quicktabs-tabs quicktabs-style-nostyle">
  310. <li class="grid-feat-ad-style"><a class="" href="#">Grid View</a></li>
  311. <li class="list-feat-ad-style"><a class="" href="#">List View</a></li>
  312. </ul>
  313.  
  314. <div class="pane">
  315.  
  316. <div id="carousel-buttons">
  317. <a href="#" id="carousel-prev">&#8592; Previous </a>
  318. <a href="#" id="carousel-next"> Next &#8594;</a>
  319. </div>
  320.  
  321. <div id="projects-carousel"> <?php global $paged, $wp_query, $wp; $args = wp_parse_args($wp->matched_query); $cat_id = get_cat_ID(single_cat_title('', false)); $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('post_type=post&posts_per_page=-1&cat='.$cat_id);
  322. $current = -1; ?>
  323.  
  324. <?php while ($wp_query->have_posts()) : $wp_query->the_post();
  325. $featured_post = "0";
  326. $post_price_plan_activation_date = get_post_meta($post->ID, 'post_price_plan_activation_date', true);
  327. $post_price_plan_expiration_date = get_post_meta($post->ID, 'post_price_plan_expiration_date', true);
  328. $post_price_plan_expiration_date_noarmal = get_post_meta($current_post, 'post_price_plan_expiration_date_normal', true);
  329. $todayDate = strtotime(date('m/d/Y h:i:s'));
  330. $expireDate = $post_price_plan_expiration_date;
  331.  
  332. if(!empty($post_price_plan_activation_date)) {
  333.  
  334. if(($todayDate < $expireDate) or $post_price_plan_expiration_date == 0) {
  335. $featured_post = "1";
  336. }
  337.  
  338. } ?>
  339.  
  340. <?php if($featured_post == "1") {
  341.  
  342. $current++;
  343.  
  344. ?>
  345.  
  346. <div class="ad-box span3">
  347.  
  348. <a class="ad-image" href="<?php the_permalink(); ?>">
  349. <?php require_once(TEMPLATEPATH . '/inc/BFI_Thumb.php'); ?>
  350.  
  351. <?php
  352.  
  353. $thumb_id = get_post_thumbnail_id();
  354. $thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail-size', true);
  355.  
  356. $params = array( 'width' => 440, 'height' => 290, 'crop' => true );
  357. echo "<img class='add-box-main-image' src='" . bfi_thumb( "$thumb_url[0]", $params ) . "'/>";
  358.  
  359.  
  360. $attachments = get_children(array('post_parent' => $post->ID,
  361. 'post_status' => 'inherit',
  362. 'post_type' => 'attachment',
  363. 'post_mime_type' => 'image',
  364. 'order' => 'ASC',
  365. 'orderby' => 'menu_order ID'));
  366.  
  367. $currentImg = 0;
  368.  
  369. foreach($attachments as $att_id => $attachment) {
  370. $full_img_url = wp_get_attachment_url($attachment->ID);
  371.  
  372. $currentImg++;
  373.  
  374. if($currentImg == 2) {
  375.  
  376. echo "<img class='add-box-second-image' src='" . bfi_thumb( "$full_img_url", $params ) . "'/>";
  377.  
  378. }
  379.  
  380. }
  381.  
  382. if($currentImg < 2) {
  383.  
  384. echo "<img class='add-box-second-image' src='" . bfi_thumb( "$thumb_url[0]", $params ) . "'/>";
  385.  
  386. }
  387.  
  388.  
  389. ?>
  390.  
  391. </a>
  392.  
  393. <div class="ad-box-content">
  394.  
  395. <span class="ad-category">
  396.  
  397. <?php
  398.  
  399. $category = get_the_category();
  400.  
  401. if ($category[0]->category_parent == 0) {
  402.  
  403. $tag = $category[0]->cat_ID;
  404.  
  405. $tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
  406. if (isset($tag_extra_fields[$tag])) {
  407. $category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
  408. $category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
  409. }
  410.  
  411. } else {
  412.  
  413. $tag = $category[0]->category_parent;
  414.  
  415. $tag_extra_fields = get_option(MY_CATEGORY_FIELDS);
  416. if (isset($tag_extra_fields[$tag])) {
  417. $category_icon_code = $tag_extra_fields[$tag]['category_icon_code'];
  418. $category_icon_color = $tag_extra_fields[$tag]['category_icon_color'];
  419. }
  420.  
  421. }
  422.  
  423. if(!empty($category_icon_code)) {
  424.  
  425. ?>
  426.  
  427. <div class="category-icon-box" style="background-color: <?php echo $category_icon_color; ?>;"><?php $category_icon = stripslashes($category_icon_code); echo $category_icon; ?></div>
  428.  
  429. <?php }
  430.  
  431. $your_image_url = "";
  432.  
  433. ?>
  434.  
  435. </span>
  436.  
  437. <a href="<?php the_permalink(); ?>"><?php $theTitle = get_the_title(); $theTitle = (strlen($theTitle) > 40) ? substr($theTitle,0,37).'...' : $theTitle; echo $theTitle; ?></a>
  438.  
  439. <?php $post_price = get_post_meta($post->ID, 'post_price', true); ?>
  440. <div class="add-price"><span><?php echo $post_price; ?></span></div>
  441.  
  442. </div>
  443.  
  444. </div>
  445.  
  446. <?php } ?>
  447.  
  448. <?php endwhile; ?>
  449.  
  450. <?php wp_reset_query(); ?>
  451.  
  452. </div>
  453.  
  454. <?php wp_enqueue_script( 'jquery-carousel', get_template_directory_uri().'/js/jquery.carouFredSel-6.2.1-packed.js', array('jquery'),'',true); ?>
  455.  
  456.  
  457. <!-- end scripts -->
  458.  
  459. </div>
  460.  
  461. <div class="pane">
  462.  
  463. <?php
  464.  
  465. global $paged, $wp_query, $wp;
  466.  
  467. $args = wp_parse_args($wp->matched_query);
  468.  
  469. $cat_id = get_cat_ID(single_cat_title('', false));
  470.  
  471. $temp = $wp_query;
  472.  
  473. $wp_query= null;
  474.  
  475. $wp_query = new WP_Query();
  476.  
  477. $wp_query->query('post_type=post&posts_per_page=-1&cat='.$cat_id);
  478.  
  479. $current = -1;
  480. echo "dddd";
  481. ?>
  482.  
  483. <?php while ($wp_query->have_posts()) : $wp_query->the_post();
  484.  
  485. $featured_post = "0";
  486.  
  487. $post_price_plan_activation_date = get_post_meta($post->ID, 'post_price_plan_activation_date', true);
  488. $post_price_plan_expiration_date = get_post_meta($post->ID, 'post_price_plan_expiration_date', true);
  489. $post_price_plan_expiration_date_noarmal = get_post_meta($current_post, 'post_price_plan_expiration_date_normal', true);
  490. $todayDate = strtotime(date('m/d/Y h:i:s'));
  491. $expireDate = $post_price_plan_expiration_date;
  492.  
  493. if(!empty($post_price_plan_activation_date)) {
  494.  
  495. if(($todayDate < $expireDate) or $post_price_plan_expiration_date == 0) {
  496. $featured_post = "1";
  497. }
  498.  
  499. } ?>
  500.  
  501. <?php if($featured_post == "1") {
  502.  
  503. $current++;
  504. echo "eeee";
  505. ?>
  506.  
  507. <div class="list-featured-ads">
  508.  
  509. <div class="list-feat-ad-image">
  510.  
  511. <a class="ad-image" href="<?php the_permalink(); ?>">
  512.  
  513. <?php require_once(TEMPLATEPATH . '/inc/BFI_Thumb.php'); ?>
  514.  
  515. <?php
  516.  
  517. $thumb_id = get_post_thumbnail_id();
  518. $thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail-size', true);
  519.  
  520. $params = array( 'width' => 440, 'height' => 290, 'crop' => true );
  521. echo "<img class='add-box-main-image' src='" . bfi_thumb( "$thumb_url[0]", $params ) . "'/>";
  522.  
  523.  
  524. $attachments = get_children(array('post_parent' => $post->ID,
  525. 'post_status' => 'inherit',
  526. 'post_type' => 'attachment',
  527. 'post_mime_type' => 'image',
  528. 'order' => 'ASC',
  529. 'orderby' => 'menu_order ID'));
  530.  
  531. $currentImg = 0;
  532.  
  533. foreach($attachments as $att_id => $attachment) {
  534. $full_img_url = wp_get_attachment_url($attachment->ID);
  535.  
  536. $currentImg++;
  537.  
  538. if($currentImg == 2) {
  539.  
  540. echo "<img class='add-box-second-image' src='" . bfi_thumb( "$full_img_url", $params ) . "'/>";
  541.  
  542. }
  543.  
  544. }
  545.  
  546. if($currentImg < 2) {
  547.  
  548. echo "<img class='add-box-second-image' src='" . bfi_thumb( "$thumb_url[0]", $params ) . "'/>";
  549.  
  550. }
  551.  
  552. ?>
  553.  
  554. </a>
  555.  
  556. </div>
  557.  
  558. <div class="list-feat-ad-content">
  559.  
  560. <div class="list-feat-ad-title">
  561.  
  562. <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
  563.  
  564. <?php $post_price = get_post_meta($post->ID, 'post_price', true); ?>
  565. <div class="add-price"><span><?php echo $post_price; ?></span></div>
  566.  
  567. </div>
  568.  
  569. <div class="list-feat-ad-excerpt">
  570. <p>
  571. <?php
  572. $content = get_the_content();
  573. echo wp_trim_words( $content , '20' );
  574. ?>
  575. </p>
  576. </div>
  577.  
  578. <div class="read-more"> <a href="<?php the_permalink(); ?>"><?php _e( 'Details', 'agrg' ); ?></a></div>
  579.  
  580. </div>
  581.  
  582. </div>
  583.  
  584.  
  585. <?php } ?>
  586.  
  587. <?php endwhile; ?>
  588.  
  589. <?php wp_reset_query(); ?>
  590.  
  591. </div>
  592.  
  593. </div>
  594.  
  595. </div>
  596.  
  597. </section>
  598.  
  599. <?php } ?>
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610. <section id="ads-category-content">
  611.  
  612. <div class="container">
  613.  
  614. <div class="span9 first">
  615.  
  616. <ul class="tabs quicktabs-tabs quicktabs-style-nostyle">
  617. <li >
  618. <a style="font-size: 18px !important; font-weight: bold;" class="current" href="#latest"><?php _e( 'Latest Ads', 'agrg' ); ?></a>
  619. </li>
  620.  
  621.  
  622. <li>
  623. <a style="font-size: 18px !important; font-weight: bold; color: #1aaf5d;"class="" href="#free" ><?php _e( 'Free Ads', 'agrg' ); ?></a>
  624.  
  625. </li>
  626. <li>
  627. <a style="font-size: 18px !important; font-weight: bold; color: #ff8800;" class="" href="#wanted"><?php _e( 'Wanted Ads', 'agrg' ); ?></a>
  628. </li>
  629. <li>
  630. <a style="font-size: 18px !important; font-weight: bold; color: #ef1207;" class="" href="#forsale"><?php _e( 'For Sale Ads', 'agrg' ); ?></a>
  631. </li>
  632. <li>
  633. <a style="font-size: 18px !important; font-weight: bold; color: #af1b6e;" class="" href="#swap"><?php _e( 'Swap Ads', 'agrg' ); ?></a>
  634. </li>
  635. </ul>
  636.  
  637.  
  638.  
  639.  
  640. <div class="pane latest-ads-holder">
  641.  
  642. <div class="latest-ads-grid-holder">
  643.  
  644. <?php
  645.  
  646. global $paged, $wp_query, $wp;
  647.  
  648. $args = wp_parse_args($wp->matched_query);
  649.  
  650. if ( !empty ( $args['paged'] ) && 0 == $paged ) {
  651.  
  652. $wp_query->set('paged', $args['paged']);
  653.  
  654. $paged = $args['paged'];
  655.  
  656. }
  657.  
  658. $cat_id = get_cat_ID(single_cat_title('', false));
  659.  
  660. $temp = $wp_query;
  661.  
  662. $wp_query= null;
  663.  
  664. $wp_query = new WP_Query();
  665.  
  666. $wp_query->query('post_type=post&posts_per_page=12&paged='.$paged.'&cat='.$cat_id);
  667.  
  668. $current = -1;
  669. $current2 = 0;
  670.  
  671. ?>
  672.  
  673. <?php
  674. $x = $wp_query->have_posts();
  675.  
  676. if (empty($x)){
  677.  
  678. echo "<br><center><span class="error" style="color: #bfbfbf; margin-bottom: 20px; font-size: 18px; font-weight: bold;">No ads in this category.</span></center>";
  679.  
  680. }
  681.  
  682. while ($wp_query->have_posts()) : $wp_query->the_post(); $current++; $current2++;
  683.  
  684. ?>
  685.  
  686. <div class="ad-box span3 latest-posts-grid <?php if($current%3 == 0) { echo 'first'; } ?>">
  687.  
  688. <a class="ad-image" href="<?php the_permalink(); ?>">
  689. <?php require_once(TEMPLATEPATH . '/inc/BFI_Thumb.php'); ?>
  690.  
  691. <?php $thumb_id = get_post_thumbnail_id(); if (trim($thumb_id =="")) { $thumb_id = get_site_url(); $thumb_id .= "/noi.png"; $params = array( 'width' => 440, 'height' => 290, 'crop' => true ); echo "<img class='add-box-main-image' src="$thumb_id"/>"; } else{ $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID ); $attachments = get_posts( $args ); if ( $attachments ) { foreach ( $attachments as $attachment ) { echo '<li>'; echo wp_get_attachment_image( $attachment->ID, 'full' ); echo '<p>'; echo apply_filters( 'the_title', $attachment->post_title ); echo '</p></li>'; } } $thumb_id = get_post_thumbnail_id(); $thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail-size', true); $params = array( 'width' => 440, 'height' => 290, 'crop' => true ); echo "<img class='add-box-main-image' src='" . bfi_thumb( "$thumb_url[0]", $params ) . "'/>"; $attachments = get_children(array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID')); $currentImg = 0; foreach($attachments as $att_id => $attachment) { $full_img_url = wp_get_attachment_url($attachment->ID); $currentImg++; } } ?>
  692.  
  693. </a>
  694.  
  695. <div class="ad-box-content">
  696.  
  697.  
  698. <div class="add-price"><span class="add-price" style="text-transform: uppercase;"><?php $post_price = get_post_meta($post->ID, 'post_price', true);
  699.  
  700.  
  701.  
  702.  
  703.  
  704. if (trim($post_price =="FREE")) {
  705. $post_price = get_post_meta($post->ID, 'post_price', true);
  706. echo "<span class="ad-page-pricegreen">$post_price</span> ";
  707. }
  708.  
  709. else if (trim($post_price =="Free")) {
  710. $post_price = get_post_meta($post->ID, 'post_price', true);
  711. echo "<span class="ad-page-pricegreen">$post_price</span>";
  712. }
  713.  
  714. else if (trim($post_price == "WANTED")){
  715. $post_price = get_post_meta($post->ID, 'post_price', true);
  716. echo "<span class="ad-page-priceorange">$post_price</span> ";
  717. }else if (trim($post_price == "Wanted")){
  718. $post_price = get_post_meta($post->ID, 'post_price', true);
  719. echo "<span class="ad-page-priceorange">$post_price</span> ";
  720. }else if (trim($post_price == "SWAP")){ $post_price = get_post_meta($post->ID, 'post_price', true); echo "<span class="ad-page-pricepurple">$post_price</span> "; }
  721. else{
  722. $post_price = get_post_meta($post->ID, 'post_price', true);
  723. echo "<span class="ad-page-pricered">$post_price</span>";
  724. }
  725. ?> </span></div> <a href="<?php the_permalink(); ?>"><?php $theTitle = get_the_title(); $theTitle = (strlen($theTitle) > 40) ? substr($theTitle,0,37).'...' : $theTitle; echo $theTitle; ?></a>
  726.  
  727.  
  728. </div>
  729.  
  730. </div>
  731.  
  732. <?php endwhile; ?>
  733.  
  734. </div>
  735.  
  736. <!-- Begin wpcrown_pagination-->
  737. <?php
  738.  
  739.  
  740.  
  741. if( $wp_rewrite->using_permalinks() )
  742. $wpcrown_pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg('s',get_pagenum_link(1) ) ) . 'page/%#%/#latest', 'paged');
  743.  
  744. if (empty($x)){
  745.  
  746. } else{
  747. if( !empty($wp_query->query_vars['s']) ) {
  748. $wpcrown_pagination['add_args'] = array('s'=>get_query_var('s'));
  749. } else{
  750. echo '<div class="pagination">' . paginate_links($wpcrown_pagination) . '</div>'; }
  751. }
  752. $checker = 1;
  753. ?>
  754. <!-- End wpcrown_pagination-->
  755.  
  756.  
  757.  
  758. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement