Latest Posts vs. Static Page – Display Posts Grid, Without Coding Content Views
-
Hi.
I have two questions about the PlugIn “Display Posts Grid, List Without Coding – Content Views”.Q1) When my site has the “static page” as the front page, the Grid shows, but when its front page is “latest posts”, the grid doesn’t work.
As I searched the forum, I have tried two ways to put the code in the theme’s index page.<?php get_header(); ?>
<section class=”content”>
<?php if ( ! hu_is_home_empty() ) : ?>
<?php hu_get_template_part(‘parts/page-title’); ?><div class=”pad group”>
<?php if ( hu_is_checked(‘featured-posts-enabled’) ) { get_template_part(‘parts/featured’); } ?>
<?php if ( have_posts() ) : ?>
<?php if ( hu_is_checked(‘blog-standard’) ): ?>
<?php while ( have_posts() ): the_post(); ?>
<?php get_template_part(‘content-standard’); ?>
<?php endwhile; ?>
<?php else: ?>
<div id=”grid-wrapper” class=”post-list group”>
<?php $i = 1; echo ‘<div class=”post-row”>’; while ( have_posts() ): the_post(); ?>
<?php get_template_part(‘content’); ?>
<?php if($i % 2 == 0) { echo ‘</div><div class=”post-row”>’; } $i++; endwhile; echo ‘</div>’; ?>
</div><!–/.post-list–>
<?php endif; ?><?php get_template_part(‘parts/pagination’); ?>
<?php endif; ?>
</div><!–/.pad–>
<?php endif; ?>
</section><!–/.content–><?php get_sidebar(); ?>
<?php get_footer(); ?>
<?php
/* CV: show custom grid on homepage */
if ( is_front_page() && !is_home() ) {
echo do_shortcode( “[pt_view id=ID: xxxxx]” );
}
?>This didn’t work, so I tried the other way now
<?php get_header(); ?>
<section class=”content”>
<?php if ( ! hu_is_home_empty() ) : ?>
<?php hu_get_template_part(‘parts/page-title’); ?><div class=”pad group”>
<?php if ( hu_is_checked(‘featured-posts-enabled’) ) { get_template_part(‘parts/featured’); } ?>
<?php if ( have_posts() ) : ?>
<?php if ( hu_is_checked(‘blog-standard’) ): ?>
<?php while ( have_posts() ): the_post(); ?>
<?php get_template_part(‘content-standard’); ?>
<?php endwhile; ?>
<?php else: ?>
<div id=”grid-wrapper” class=”post-list group”>
<?php $i = 1; echo ‘<div class=”post-row”>’; if ( !is_front_page() && is_home() ) :
echo do_shortcode(“[pt_view id=xxxxx]”);
else : while ( have_posts() ): the_post(); ?>
<?php get_template_part(‘content’); ?>
<?php if($i % 2 == 0) { echo ‘</div><div class=”post-row”>’; } $i++; endwhile; endif; echo ‘</div>’; ?>
</div><!–/.post-list–>
<?php endif; ?><?php get_template_part(‘parts/pagination’); ?>
<?php endif; ?>
</div><!–/.pad–>
<?php endif; ?>
</section><!–/.content–><?php get_sidebar(); ?>
<?php get_footer(); ?>
I still cannot make the grid work when I have the front page as “latest post”.
The grid you can see in my website is from the theme, not the plugin.
Will you please help me?Q2) I thought we could put the recent(latest) post in each category to make up the grid in each row, but it seems as though they are from all the category by the date.
How can I have each row from each different category? That is what I wanted, so I downloaded this plugin.Thank you so much.
- The topic ‘Latest Posts vs. Static Page – Display Posts Grid, Without Coding Content Views’ is closed to new replies.