empty page category
-
Hello everyone,
I created a page (page-theater.php), Showing the evidence images of this category<?php /** * Template Name: teatro * * * @package WordPress * @subpackage riccardodeluca * @since Riccardo de Luca 1.0 */ get_header(); $the_query2 = new WP_Query( 'cat=11' ); ?> <div class="container"> <div class="row"> <?php while ( $the_query2->have_posts() ) : $the_query2->the_post(); ?> <div class="col-sm-6 col-xs-12"> <div clas="title"><?php the_title('<h1 class="text-center">', '</h1>') ?></div> <?php the_post_thumbnail('full', array('class' => "img-responsive center-block")); ?> <div class="text-uppercase text-center"><h4><a href="<?php echo get_permalink( $post->ID ); ?>">read more</a></h4></div> <hr style="border:2px solid "> </div> <?php endwhile; wp_reset_query(); wp_reset_postdata() ?> </div> </div> <?php get_footer(); ?>If I click on the link I would like to show me the details of the post
<?php echo get_permalink( $post->ID ); ?>But the page is empty
The code page category is:
<?php /** * The template for displaying Category pages * * @link https://codex.ww.wp.xz.cn/Template_Hierarchy * * @package WordPress * @subpackage Riccardo De Luca * @since Riccardo De Luca 1.0 */ get_header(); ?> <div class="container" style="margin-bottom:30px;"> <div class="row"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class=" col-xs-12 col-sm-4"> <?php if(has_post_thumbnail()) { ?> <?php the_title('<h1 class="title">','</h1>', true) ?> <hr> <?php the_post_thumbnail(array(300), array('class' => "img-responsive") ); ?> <?php } ?> </div> <div class="col-xs-12 col-sm-8 " style="margin-top:20px; min-height:300px;"> <?php the_content(); ?> </div> <hr class="clearfix" style="border:2px solid #333;"> <?php endwhile; endif; wp_reset_query(); wp_reset_postdata() ?> </div> </div> <?php get_footer(); ?>can someone help me? I’m inexperience.
thank you
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘empty page category’ is closed to new replies.