Skip to content

Instantly share code, notes, and snippets.

@brashrebel
Forked from AutumnEyes/book-query.php
Last active August 29, 2015 14:02

Revisions

  1. brashrebel revised this gist Jun 24, 2014. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions book-query.php
    Original file line number Diff line number Diff line change
    @@ -16,15 +16,15 @@
    //Taxonomy Parameters
    'tax_query' => array(
    'relation' => 'AND',
    array(
    'taxonomy' => 'faculty',
    'field' => 'id',
    'terms' => $post_id
    ),
    array(
    'taxonomy' => 'accomplishtype',
    'field' => 'slug',
    'terms' => 'book'
    ),
    array(
    'taxonomy' => 'faculty',
    'field' => 'id',
    'terms' => $post_id
    )
    )
    );
  2. brashrebel revised this gist Jun 24, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions book-query.php
    Original file line number Diff line number Diff line change
    @@ -31,6 +31,9 @@
    $book_query = new WP_Query( $args );

    if ($book_query->have_posts()) {
    echo '<pre>';
    print_r($book_query);
    echo '</pre>';
    ?>
    <h3>Books</h3>

  3. brashrebel revised this gist Jun 24, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions book-query.php
    Original file line number Diff line number Diff line change
    @@ -23,8 +23,8 @@
    ),
    array(
    'taxonomy' => 'accomplishtype',
    'field' => 'id',
    'terms' => $post_id
    'field' => 'slug',
    'terms' => 'book'
    )
    )
    );
  4. brashrebel revised this gist Jun 24, 2014. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions book-query.php
    Original file line number Diff line number Diff line change
    @@ -20,6 +20,11 @@
    'taxonomy' => 'faculty',
    'field' => 'id',
    'terms' => $post_id
    ),
    array(
    'taxonomy' => 'accomplishtype',
    'field' => 'id',
    'terms' => $post_id
    )
    )
    );
  5. brashrebel revised this gist Jun 24, 2014. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions book-query.php
    Original file line number Diff line number Diff line change
    @@ -31,11 +31,13 @@

    <div class="row">
    <ul>
    <?php while ( $book_query->have_posts() ) : $book_query->the_post(); ?>

    <?php while ( $book_query->have_posts() ) : $book_query->the_post();
    $id = get_the_id();
    ?>

    <li>
    <h3><?php the_title(); ?></h3>
    <?php echo get_post_meta( get_the_ID(), 'ct_Accomplish_textarea_ac19', true ); ?>
    <?php echo get_post_meta( $id, 'ct_Accomplish_textarea_ac19', true ); ?>
    </li>

    <?php endwhile; ?>
  6. brashrebel revised this gist Jun 24, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion book-query.php
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@

    <li>
    <h3><?php the_title(); ?></h3>
    <?php get_post_meta( get_the_ID(), 'ct_Accomplish_textarea_ac19', true ); ?>
    <?php echo get_post_meta( get_the_ID(), 'ct_Accomplish_textarea_ac19', true ); ?>
    </li>

    <?php endwhile; ?>
  7. brashrebel revised this gist Jun 24, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion book-query.php
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,10 @@
    <ul>
    <?php while ( $book_query->have_posts() ) : $book_query->the_post(); ?>

    <li><?php get_post_meta( get_the_ID(), 'ct_Accomplish_textarea_ac19', true ); ?></li>
    <li>
    <h3><?php the_title(); ?></h3>
    <?php get_post_meta( get_the_ID(), 'ct_Accomplish_textarea_ac19', true ); ?>
    </li>

    <?php endwhile; ?>
    </ul>
  8. brashrebel revised this gist Jun 24, 2014. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions book-query.php
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    <?php

    <?php
    // CUSTOM BOOK QUERY
    $post_id = get_the_ID();

    @@ -25,19 +24,20 @@
    )
    );
    $book_query = new WP_Query( $args );

    if ($book_query->have_posts()) {
    ?>
    <h3>Books</h3>

    <div class="row">
    <ul>
    <?php while ( $book_query->have_posts() ) : $book_query->the_post();
    echo '<li>'.get_post_meta( get_the_ID(), 'ct_Accomplish_textarea_ac19', true ).'</li>';
    <?php while ( $book_query->have_posts() ) : $book_query->the_post(); ?>

    endwhile;
    echo '</ul>';
    wp_reset_query(); ?>
    <li><?php get_post_meta( get_the_ID(), 'ct_Accomplish_textarea_ac19', true ); ?></li>

    <?php endwhile; ?>
    </ul>
    <?php wp_reset_query(); ?>
    </div>
    <?php }

    ?>
  9. brashrebel revised this gist Jun 24, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion book-query.php
    Original file line number Diff line number Diff line change
    @@ -30,10 +30,12 @@
    <h3>Books</h3>

    <div class="row">
    <ul>
    <?php while ( $book_query->have_posts() ) : $book_query->the_post();
    echo get_post_meta( get_the_ID(), 'ct_Accomplish_textarea_ac19', true );
    echo '<li>'.get_post_meta( get_the_ID(), 'ct_Accomplish_textarea_ac19', true ).'</li>';

    endwhile;
    echo '</ul>';
    wp_reset_query(); ?>
    </div>
    <?php }
  10. brashrebel revised this gist Jun 24, 2014. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions book-query.php
    Original file line number Diff line number Diff line change
    @@ -26,13 +26,11 @@
    );
    $book_query = new WP_Query( $args );
    if ($book_query->have_posts()) {
    print_r( $book_query );
    ?>
    <h3>Books</h3>

    <div class="row">
    <?php while ( $book_query->have_posts() ) : $book_query->the_post();
    echo 'score';
    echo get_post_meta( get_the_ID(), 'ct_Accomplish_textarea_ac19', true );

    endwhile;
  11. brashrebel revised this gist Jun 24, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion book-query.php
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@
    <div class="row">
    <?php while ( $book_query->have_posts() ) : $book_query->the_post();
    echo 'score';
    echo get_post_meta( $post_id, 'ct_Accomplish_textarea_ac19', true );
    echo get_post_meta( get_the_ID(), 'ct_Accomplish_textarea_ac19', true );

    endwhile;
    wp_reset_query(); ?>
  12. brashrebel revised this gist Jun 24, 2014. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions book-query.php
    Original file line number Diff line number Diff line change
    @@ -20,23 +20,21 @@
    array(
    'taxonomy' => 'faculty',
    'field' => 'id',
    'terms' => array( $post_id )
    'terms' => $post_id
    )
    )
    );
    $book_query = new WP_Query( $args );
    if ($book_query->have_posts()) {
    print_r( $book_query );
    ?>
    <h3>Books</h3>

    <div class="row">
    <?php while ( $book_query->have_posts() ) : $book_query->the_post();
    echo 'score';
    echo get_post_meta( $post_id, 'ct_Accomplish_textarea_ac19', true );



    //wp_meta();
    // put in markup and wordpress tags . the title . the post thumbnail
    endwhile;
    wp_reset_query(); ?>
    </div>
  13. brashrebel revised this gist Jun 24, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions book-query.php
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    <?php

    // CUSTOM BOOK QUERY
    $post_id = get_the_ID();

    $args = array(

  14. brashrebel revised this gist Jun 24, 2014. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions book-query.php
    Original file line number Diff line number Diff line change
    @@ -14,23 +14,23 @@
    //Pagination Parameters
    'posts_per_page' => -1,
    //Taxonomy Parameters
    //'tax_query' => array(
    //'relation' => 'AND',
    // array(
    // 'taxonomy' => 'service',
    // 'field' => 'id',
    // 'terms' => array( $post_id )
    // )
    //)
    'tax_query' => array(
    'relation' => 'AND',
    array(
    'taxonomy' => 'faculty',
    'field' => 'id',
    'terms' => array( $post_id )
    )
    )
    );
    $book_query = new WP_Query( $args );
    if ($book_query->have_posts()) {
    ?>
    <h3>Books1</h3>
    <h3>Books</h3>

    <div class="row">
    <?php while ( $book_query->have_posts() ) : $book_query->the_post();
    the_meta(ct_Accomplish_textarea_ac19);
    echo get_post_meta( $post_id, 'ct_Accomplish_textarea_ac19', true );



  15. @AutumnEyes AutumnEyes created this gist Jun 24, 2014.
    44 changes: 44 additions & 0 deletions book-query.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    <?php

    // CUSTOM BOOK QUERY

    $args = array(

    //Type & Status Parameters
    'post_type' => 'accomplishment',
    'post_status' => 'publish',

    //Order & Orderby Parameters
    'order' => 'ASC',
    'orderby' => 'name',
    //Pagination Parameters
    'posts_per_page' => -1,
    //Taxonomy Parameters
    //'tax_query' => array(
    //'relation' => 'AND',
    // array(
    // 'taxonomy' => 'service',
    // 'field' => 'id',
    // 'terms' => array( $post_id )
    // )
    //)
    );
    $book_query = new WP_Query( $args );
    if ($book_query->have_posts()) {
    ?>
    <h3>Books1</h3>

    <div class="row">
    <?php while ( $book_query->have_posts() ) : $book_query->the_post();
    the_meta(ct_Accomplish_textarea_ac19);



    //wp_meta();
    // put in markup and wordpress tags . the title . the post thumbnail
    endwhile;
    wp_reset_query(); ?>
    </div>
    <?php }

    ?>
    89 changes: 89 additions & 0 deletions single-faculty.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,89 @@
    <?php
    /*
    Template Name: Faculty Page
    */

    /**
    * Single Post Template
    *
    * This template is the default page template. It is used to display content when someone is viewing a
    * singular view of a post ('post' post_type).
    * @link http://codex.wordpress.org/Post_Types#Post
    *
    * @package WooFramework
    * @subpackage Template
    */

    get_header();
    ?>

    <!-- #content Starts -->
    <?php woo_content_before(); ?>
    <div id="content" class="col-full">

    <div id="main-sidebar-container">

    <!-- #main Starts -->
    <?php woo_main_before(); ?>
    <section id="main">

    <header><h1 class="title"><?php single_post_title(); ?></h1></header>
    <?php include 'book-query.php'; ?>

    <?php

    $title_before = '<h1 class="title">';
    $title_after = '</h1>';

    if ( ! is_single() ) {
    $title_before = $title_before . '<a href="' . get_permalink( get_the_ID() ) . '" rel="bookmark" title="' . the_title_attribute( array( 'echo' => 0 ) ) . '">';
    $title_after = '</a>' . $title_after;
    }

    $page_link_args = apply_filters( 'woothemes_pagelinks_args', array( 'before' => '<div class="page-link">' . __( 'Pages:', 'woothemes' ), 'after' => '</div>' ) );

    woo_post_before();
    ?>
    <article <?php post_class(); ?>>
    <?php
    woo_post_inside_before();
    ?>
    <header>
    <?php the_title( $title_before, $title_after ); ?>
    </header>
    <?php
    //woo_post_meta();
    ?>
    <section class="entry">
    <?php
    the_content();
    wp_link_pages( $page_link_args )
    ?>
    <hr />
    <?php
    echo do_shortcode('[custom_fields_block] [ct_filter terms="book"]ct_Accomplish_textarea_ac19[/ct_filter] [/custom_fields_block]')
    ?>
    </section><!-- /.entry -->
    <?php
    //woo_post_inside_after();

    ?>
    </article><!-- /.post -->
    <?php
    //woo_post_after();
    //comments_template();
    ?>

    </section><!-- /#main -->
    <?php woo_main_after(); ?>

    <?php get_sidebar(); ?>

    </div><!-- /#main-sidebar-container -->

    <?php get_sidebar('alt'); ?>

    </div><!-- /#content -->
    <?php woo_content_after(); ?>

    <?php get_footer(); ?>