function widget($args, $instance) { global $post, $wpdb; echo $args['before_widget']; echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title']; if (!empty($post->post_excerpt)) { ?> <div class='content mb11'> <?php the_excerpt(); ?> </div> <?php } $customdata = get_option('est_customdata'); $taxonomies = get_option('est_taxonomies'); $options = array(); $options['single_address_order'] = $instance['single_field_address_order']; $options['single_address'] = $instance['single_field_address']; $options['_est_single_field_address_name'] = $instance['single_field_address_name']; $i = 0; if ($instance['shown_fields'] == 'all') { foreach ($taxonomies as $taxonomy => $data) { $options['custom_taxonomies'][$taxonomy] = array('show' => 'yes', 'order' => $i); $i++; } foreach ($customdata as $key => $data) { $options['customdatas'][$key] = array('show' => 'yes', 'order' => $i); $i++; } } else { $options['customdatas'] = $instance['est_customfields']; $options['custom_taxonomies'] = $instance['est_taxonomies']; } show_property_detail_table(get_property_detail_list($options)); echo $args['after_widget']; }
function get_property_subtitle_details($subtitle_options) { $options = array('customdatas' => array(), 'custom_taxonomies' => array()); if (!empty($subtitle_options['subtitle'])) { $details = explode('|', $subtitle_options['subtitle']); $i = 1; foreach ($details as $detail) { if (substr_count($detail, 'taxonomy-') > 0) { $taxonomy = trim(str_replace('taxonomy-', '', $detail)); $options['custom_taxonomies'][$taxonomy] = array('show' => 'yes', 'order' => $i); } else { $name = trim('_est_meta_' . $detail); $options['customdatas'][$name] = array('show' => 'yes', 'order' => $i); } if ($detail == 'single_address') { $options['single_address_order'] = $i; } $i++; } } else { $defaults = get_option('est_property_subtitles'); foreach ($defaults as $name => $order) { $options['customdatas'][$name] = array('show' => 'yes', 'order' => $order); } } $details = get_property_detail_list($options); return $details; }
?> </a></h1> <?php if (!empty($subtitle)) { ?> <h2 class='light'><?php echo $subtitle; ?> </h2> <?php } ?> </hgroup> <?php show_property_detail_table(get_property_detail_list($options)); ?> <?php if ($options['excerpt'] == true) { ?> <div class='excerpt content mb11'> <?php $length = get_theme_mod('property_excerpt_length'); ob_start(); the_excerpt(); $excerpt = ob_get_clean(); if (!empty($length) and !empty($excerpt)) { $excerpt = strip_tags($excerpt); $excerpt = substr($excerpt, 0, $length); $spos = strrpos($excerpt, ' ');
<?php if (!empty($location)) { ?> <h2 class='light'><?php echo $location; ?> </h2> <?php } ?> </hgroup> <div class='details'> <div class="info light"> <?php $details = get_property_detail_list($options); $details = array_slice($details, 0, 2); $display = array(); foreach ($details as $detail) { $display[] = $detail['value']; } echo implode(' - ', $display); ?> </div> <a class='button small' href='<?php the_permalink(); ?> '><?php _e('details', THEMENAME); ?> </a>