Skip to content

Instantly share code, notes, and snippets.

@diegoliv
Last active December 14, 2015 13:43

Revisions

  1. diegoliv revised this gist Dec 14, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions single-cursos.php
    Original file line number Diff line number Diff line change
    @@ -29,8 +29,8 @@
    <?php endwhile; ?>
    <?php endif; ?>

    <?php previous_posts_link( __( 'Prev' ), $disciplinas->max_num_pages ); ?>
    <?php next_posts_link( __( 'Next' ), $disciplinas->max_num_pages ); ?>
    <?php previous_post_link( __( 'Prev' ), $disciplinas->max_num_pages ); ?>
    <?php next_post_link( __( 'Next' ), $disciplinas->max_num_pages ); ?>

    <?php wp_reset_postdata(); ?>

  2. diegoliv revised this gist Dec 14, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion single-cursos.php
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    <?php

    $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1;
    $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;

    $disciplinas = new WP_Query( array(
    'post_type' => 'disciplinas',
  3. diegoliv revised this gist Dec 14, 2015. 1 changed file with 40 additions and 31 deletions.
    71 changes: 40 additions & 31 deletions single-cursos.php
    Original file line number Diff line number Diff line change
    @@ -1,31 +1,40 @@
    <?php

    $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1;

    $disciplinas = new WP_Query( array(
    'post_type' => 'disciplinas',
    'posts_per_page' => 3,
    'paged' => $paged
    ) );

    ?>

    <?php if( $disciplinas->have_posts() ) : ?>
    <?php while ( $disciplinas->have_posts() ) : $disciplinas->the_post(); ?>

    <div class="col-md-4">
    <div class="panel panel-default">
    <div class="panel-body">
    <h3><?php the_title() ?></h3>
    <a href="<?php the_permalink() ?>" class="btn btn-primary"><?php _e( 'Ver Disciplina' ) ?></a>
    </div>
    </div>
    </div>

    <?php endwhile; ?>
    <?php endif; ?>

    <?php previous_posts_link( __( 'Prev' ), $disciplinas->max_num_pages ); ?>
    <?php next_posts_link( __( 'Next' ), $disciplinas->max_num_pages ); ?>

    <?php wp_reset_postdata(); ?>
    <?php get_header(); ?>
    <div class="container">
    <div class="row">

    <?php

    $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1;

    $disciplinas = new WP_Query( array(
    'post_type' => 'disciplinas',
    'posts_per_page' => 3,
    'paged' => $paged
    ) );

    ?>

    <?php if( $disciplinas->have_posts() ) : ?>
    <?php while ( $disciplinas->have_posts() ) : $disciplinas->the_post(); ?>

    <div class="col-md-4">
    <div class="panel panel-default">
    <div class="panel-body">
    <h3><?php the_title() ?></h3>
    <a href="<?php the_permalink() ?>" class="btn btn-primary"><?php _e( 'Ver Disciplina' ) ?></a>
    </div>
    </div>
    </div>

    <?php endwhile; ?>
    <?php endif; ?>

    <?php previous_posts_link( __( 'Prev' ), $disciplinas->max_num_pages ); ?>
    <?php next_posts_link( __( 'Next' ), $disciplinas->max_num_pages ); ?>

    <?php wp_reset_postdata(); ?>

    </div>
    </div>

    <?php get_footer(); ?>
  4. diegoliv revised this gist Dec 14, 2015. 1 changed file with 23 additions and 23 deletions.
    46 changes: 23 additions & 23 deletions single-cursos.php
    Original file line number Diff line number Diff line change
    @@ -1,31 +1,31 @@
    <?php
    <?php

    $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1;
    $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1;

    $disciplinas = new WP_Query( array(
    'post_type' => 'disciplinas',
    'posts_per_page' => 3,
    'paged' => $paged
    ) );
    $disciplinas = new WP_Query( array(
    'post_type' => 'disciplinas',
    'posts_per_page' => 3,
    'paged' => $paged
    ) );

    ?>
    ?>

    <?php if( $disciplinas->have_posts() ) : ?>
    <?php while ( $disciplinas->have_posts() ) : $disciplinas->the_post(); ?>
    <?php if( $disciplinas->have_posts() ) : ?>
    <?php while ( $disciplinas->have_posts() ) : $disciplinas->the_post(); ?>

    <div class="col-md-4">
    <div class="panel panel-default">
    <div class="panel-body">
    <h3><?php the_title() ?></h3>
    <a href="<?php the_permalink() ?>" class="btn btn-primary"><?php _e( 'Ver Disciplina' ) ?></a>
    </div>
    </div>
    </div>
    <div class="col-md-4">
    <div class="panel panel-default">
    <div class="panel-body">
    <h3><?php the_title() ?></h3>
    <a href="<?php the_permalink() ?>" class="btn btn-primary"><?php _e( 'Ver Disciplina' ) ?></a>
    </div>
    </div>
    </div>

    <?php endwhile; ?>
    <?php endif; ?>
    <?php endwhile; ?>
    <?php endif; ?>

    <?php previous_posts_link( __( 'Prev' ), $disciplinas->max_num_pages ); ?>
    <?php next_posts_link( __( 'Next' ), $disciplinas->max_num_pages ); ?>
    <?php previous_posts_link( __( 'Prev' ), $disciplinas->max_num_pages ); ?>
    <?php next_posts_link( __( 'Next' ), $disciplinas->max_num_pages ); ?>

    <?php wp_reset_postdata(); ?>
    <?php wp_reset_postdata(); ?>
  5. diegoliv created this gist Dec 14, 2015.
    31 changes: 31 additions & 0 deletions single-cursos.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    <?php

    $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1;

    $disciplinas = new WP_Query( array(
    'post_type' => 'disciplinas',
    'posts_per_page' => 3,
    'paged' => $paged
    ) );

    ?>

    <?php if( $disciplinas->have_posts() ) : ?>
    <?php while ( $disciplinas->have_posts() ) : $disciplinas->the_post(); ?>

    <div class="col-md-4">
    <div class="panel panel-default">
    <div class="panel-body">
    <h3><?php the_title() ?></h3>
    <a href="<?php the_permalink() ?>" class="btn btn-primary"><?php _e( 'Ver Disciplina' ) ?></a>
    </div>
    </div>
    </div>

    <?php endwhile; ?>
    <?php endif; ?>

    <?php previous_posts_link( __( 'Prev' ), $disciplinas->max_num_pages ); ?>
    <?php next_posts_link( __( 'Next' ), $disciplinas->max_num_pages ); ?>

    <?php wp_reset_postdata(); ?>