Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //query CPT by related CPT's title
- $params = array(
- 'limit' => -1,
- 'where' => 'book_author.post_title = "J.R.R. Tolkien" '
- );
- $pods = pods( 'book', $params );
- if ( $pods->total() > 0 ) {
- while ( $pods->fetch() ) {
- echo $pods->display( 'post_title' );
- echo '<br>';
- }
- }
- <?php
- /**
- * The template for displaying all single posts
- *
- * @package WordPress
- * @subpackage Twenty_Thirteen
- * @since Twenty Thirteen 1.0
- */
- get_header(); ?>
- <div id="primary" class="content-area">
- <div id="content" class="site-content" role="main">
- <?php /* The loop */ ?>
- <?php while ( have_posts() ) : the_post();
- get_template_part( 'content', get_post_format() );
- echo get_post_meta( get_the_ID(), 'sub_title' );
- ?>
- <?php twentythirteen_post_nav(); ?>
- <?php comments_template(); ?>
- <?php endwhile; ?>
- </div><!-- #content -->
- </div><!-- #primary -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
- <?php
- /**
- * The main template file
- *
- * This is the most generic template file in a WordPress theme and one of the
- * two required files for a theme (the other being style.css).
- * It is used to display a page when nothing more specific matches a query.
- * For example, it puts together the home page when no home.php file exists.
- *
- * @link http://codex.wordpress.org/Template_Hierarchy
- *
- * @package WordPress
- * @subpackage Twenty_Thirteen
- * @since Twenty Thirteen 1.0
- */
- get_header(); ?>
- <div id="primary" class="content-area">
- <div id="content" class="site-content" role="main">
- <?php
- $params = array( 'limit' => 2 );
- $pods = pods( 'book', $params);
- if ( $pods->total() > 0 ) {
- while( $pods->fetch( ) ) {
- echo '<a href="'.get_permalink( $pods->id() ).'">'.$pods->display( 'post_title' ).'</a>';
- echo '<br>';
- }
- echo $pods->pagination();
- }
- else {
- echo 'nope';
- }
- ?>
- </div><!-- #content -->
- </div><!-- #primary -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
- <?php
- print_r2( get_term( 2, 'genre' ) );
- $params = array(
- 'limit' => -1,
- 'where' => 'genre.term_id = "2" '
- );
- $pods = pods( 'book', 300 );
- echo $pods->form( array( 'fields' => array( 'post_title', 'subtitle' ), 'fields_only' => true ) );
- var_dump( pods_v( 'bar', $params, false, true ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement