Example #1
0
">        
        <section>
            <ul>
            <li class="busdirhome"><a href="<?php 
echo home_url('/');
?>
business-directory" id="bbhome">Home</a></li>
            <li class="busdiradd"><input type="submit" class="submit bright" value="Add new Deal" /></li>
            <li class="busdirshow"><select size="1" name="search_deals_length"><option value="10">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select></li>
            <li class="busdirsearch"><input type="text" id="acpro_inp1"></li>
            </ul>
        </section>
    </form>
    <?php 
$deals = new WP_Query();
$deals->Query('post_type=dealentry&post_status=publish&posts_per_page=-1');
if ($deals->have_posts()) {
    ?>
    <div style="clear: both;"> </div>
    <table id="search_deals">
      <?php 
    build_deals_head();
    ?>
      <tbody>
        <?php 
    while ($deals->have_posts()) {
        $deals->the_post();
        // the loop
        global $post;
        $post_id = $post->ID;
        build_deals_row($post_id);
Example #2
0
/**
 * Functions area
 * 
 */
function add_exists($add_type, $matricula)
{
    global $wpdb, $wp_version, $wp_locale, $current_blog, $wp_rewrite;
    $posts = new WP_Query();
    $posts->Query('post_type=' . $add_type . '&post_status=publish');
    while ($posts->have_posts()) {
        $posts->the_post();
        if (strcmp($matricula, get_the_title()) == 0) {
            return true;
        }
    }
    return false;
}