• Hello,

    I am new at WordPress and have a problem which i cant solve. I am working with the theme Revive Pro.

    I have created a page with content and switched the template from default template to blog (Grid 4 Colums).

    The problem is that the frontend only displays the posts (from the newsletter) i have created but don′t display the page content.

    I think this problem appears one year ago in this forum but i still cant solve it.

    See here.

    For any help I would be very thankful.

Viewing 1 replies (of 1 total)
  • Thread Starter lakie85

    (@lakie85)

    This is the code of the blog template.
    
    <?php
    /**
     * The template for displaying all page with a Blog Style.
     * Template Name: Blog (Grid 4 Columns)
     *
     * @package revive
     */
    
    get_header(); ?>
    	<div id="primary" class="content-areas <?php do_action('revive_primary-width') ?>">
    		<main id="main" class="site-main" role="main">
    		<?php wp_reset_query();
    			  wp_reset_postdata();
    			  $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;
    			  $cat = get_post_meta( get_the_ID(), 'choose-category', true );
    			$qa = array (
    				'post_type'              => 'post',
    				'offset'				 => 0,
    				'ignore_sticky_posts'    => false,
    				'paged' 				 => $paged,
    				'cat'  					 => $cat, //POSSIBLE SOURCE of ERROR when $cat = all_c
    
    			);
    
    		// The Query
    		$recent_articles = new WP_Query( $qa );
    		if ( $recent_articles->have_posts() ) : ?>
    
    			<?php /* Start the Loop */ ?>
    			<?php while ( $recent_articles->have_posts() ) : $recent_articles->the_post(); ?>
    
    				<?php
    					/* Include the Post-Format-specific template for the content.
    					 */
    					get_template_part('framework/layouts/content', 'grid_4_column');  
    
    				?>
    
    			<?php endwhile; ?>
    			<?php revive_pagination_queried( $recent_articles ); ?>
    
    		<?php else : ?>
    
    			<?php get_template_part( 'content', 'none'); ?>
    
    		<?php endif; ?>
    
    		</main><!-- #main -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Display page content on blog template’ is closed to new replies.