Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hey Nicolas,

    Thanks, it really helped. So, just in case someone else would like to show posts from specific categories only, this would be the code that needs to be replaced in index.php.

    <?php if ( have_posts() && !is_404() && !is_home() ) : ?>
                                <?php while ( have_posts() ) : ?>
                                    <?php the_post(); ?>
                                    <article <?php tc__f('__article_selectors') ?>>
                                        <?php
                                            do_action( '__loop' );
                                        ?>
                                    </article>
                                <?php endwhile; ?>
    
                            <?php endif; ##end if have posts ?>
    
                            <?php if ( is_home() ) : ?>
                                <?php   $wp_query;
                                        $categoryvariable = 4;
                                        $args = 'cat=' . $categoryvariable . '&orderby=date&order=ASC';
                                        query_posts( $args );
                                ?>
                                <?php while ( have_posts() ) : ?>
                                    <?php the_post(); ?>
                                    <article <?php tc__f('__article_selectors') ?>>
                                        <?php
                                            do_action( '__loop' );
                                        ?>
                                    </article>
                                <?php endwhile; ?>
    
                            <?php endif; ##end if have posts ?>

    Note that in this case, I want to show only posts with category id of 4 on the front page:

    $categoryvariable = 4;

Viewing 1 replies (of 1 total)