Skip to content

Instantly share code, notes, and snippets.

Created May 27, 2014 20:44
Show Gist options
  • Select an option

  • Save anonymous/0459f28ad815dfc10f13 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/0459f28ad815dfc10f13 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist May 27, 2014.
    63 changes: 63 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,63 @@
    <?php
    /**
    * The template for displaying all pages.
    *
    * This is the template that displays all pages by default.
    * Please note that this is the WordPress construct of pages
    * and that other 'pages' on your WordPress site will use a
    * different template.
    *
    * @package WordPress
    * @subpackage got_deros
    * @since Got Deros 1.0
    */

    get_header(); ?>

    <div id="primary">
    <div id="content" role="main">
    <?php while ( have_posts() ) : the_post(); ?>

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <div class="entry-content">
    <div class="cpt-search">
    <form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
    <input type="text" class="field" name="s" id="s" placeholder="SEARCH LISTINGS" />
    <input type="hidden" name="post_type" value="phone-listing" />
    <input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( '&nbsp;', 'gotderos' ); ?>" />
    </form>
    </div>
    <?php the_content(); ?>

    <div class="category-list clearfix">
    <?php $terms = get_terms('city-guide-category')?>
    <?php foreach($terms as $term):
    wp_reset_query();
    $args = array('post_type' => 'city-guide',
    'tax_query' => array(
    array(
    'taxonomy' => 'city-guide-category',
    'field' => 'slug',
    'terms' => $term->slug,
    ),
    ),
    );

    $loop = new WP_Query($args);
    if($loop->have_posts()):?>
    <a href="<?php esc_url(get_term_link($term))?>"><h3><?php echo ($term->name)?></h3></a>

    <?php while($loop->have_posts()) : $loop->the_post()?>
    <a href="<?php echo (get_permalink())?>"><h4><?php echo (get_the_title())?></h4></a>
    <?php endwhile;?>
    <?php endif;?>
    <?php endforeach?>
    </div><!--cat-list-->
    <a href="/apo-friendly-merchants/" class="apo-friendly">+ <span class="red">APO FRIENDLY MERCHANTS</span></a>
    </div><!-- .entry-content -->
    </article><!-- #post-<?php the_ID(); ?>-->
    <?php endwhile; // end of the loop. ?>
    </div><!-- #content -->
    </div><!-- #primary -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>