<?php if (!$query->have_posts()) { ?> <?php _ex("No listings found.", 'templates', "WPBDM"); ?> <?php } else { ?> <div class="listings"> <?php while ($query->have_posts()) { $query->the_post(); ?> <?php echo wpbdp_render_listing(null, 'excerpt'); ?> <?php } ?> <div class="wpbdp-pagination"> <?php if (function_exists('wp_pagenavi')) { ?> <?php wp_pagenavi(array('query' => $query)); ?> <?php } else { ?>
function wpbdp_the_listing_excerpt() { echo wpbdp_render_listing(null, 'excerpt'); }
function wpbusdirman_post_excerpt($deprecated = null) { return wpbdp_render_listing(null, 'excerpt'); }
public function show_listing() { if (!$this->check_main_page($msg)) { return $msg; } $id_or_slug = ''; if (get_query_var('listing') || isset($_GET['listing'])) { $id_or_slug = get_query_var('listing') ? get_query_var('listing') : wpbdp_getv($_GET, 'listing', 0); } else { $id_or_slug = get_query_var('id') ? get_query_var('id') : wpbdp_getv($_GET, 'id', 0); } $listing_id = wpbdp_get_post_by_id_or_slug($id_or_slug, 'id', 'id'); /* if (get_query_var('listing') || isset($_GET['listing'])) { if ($posts = get_posts(array('post_status' => 'any', 'numberposts' => 1, 'post_type' => WPBDP_POST_TYPE, 'name' => get_query_var('listing') ? get_query_var('listing') : wpbdp_getv($_GET, 'listing', null) ) )) { $listing_id = $posts[0]->ID; } else { $listing_id = null; } } else { $listing_id = get_query_var('id') ? get_query_var('id') : wpbdp_getv($_GET, 'id', null); }*/ if (!$listing_id) { return; } $html = ''; if ('publish' != get_post_status($listing_id)) { if (current_user_can('edit_posts')) { $html .= wpbdp_render_msg(_x('This is just a preview. The listing has not been published yet.', 'preview', 'WPBDM')); } else { return; } } // Handle ?v=viewname argument for alternative views (other than 'single'). $view = ''; if (isset($_GET['v'])) { $view = wpbdp_capture_action_array('wpbdp_listing_view_' . trim($_GET['v']), array($listing_id)); } if (!$view) { $html .= wpbdp_render_listing($listing_id, 'single', false, true); } else { $html .= $view; } wp_reset_query(); // Just in case some shortcode messed this up. return $html; }
<?php get_header(); ?> <?php the_post(); ?> <div id="content"> <?php // Customize the output of this function using the template "businessdirectory-listing.tpl.php"; ?> <?php echo wpbdp_render_listing(null, 'single'); ?> </div> <?php get_footer();