Hi @evallad,
I hope you are well today and thank you for your question.
To make it clear i want to ask you that whether you are trying to achieve the home page as following?
https://colorlib.com/activello/
Kind Regards,
Movin
HI, I’m fine thank you. Hope you are too.
Yes I was but I changed my mind.
I keep the last articles page as homepage, desactivate the right bar and add my own code in the template to have my own elements. I would prefer to create a static homepage but impossible to get the articles loop (as shown in the https://colorlib.com/activello/ homepage).
Besides,
– I would like to hide from the homepage the articles shown in the slider. Is that possible ?
– I’d like to have the share this & related saw in this page https://colorlib.com/activello/template-featured-image-vertical/
Kind regards
I am not sure what you meant by “the last articles page as homepage” so please make it a bit clear.
Also share some screenshots and your site URL where you have made these changes so that i can better understand it and help you.
I would like to hide from the homepage the articles shown in the slider. Is that possible ?
You can try achieving this by using the following custom code as described here https://colorlib.com/wp/forums/topic/suppress-slider-on-posts-page/#post-24989
function exclude_category( $query ) {
if( ! is_category() && get_theme_mod('activello_featured_hide') == 1 ){
$slidecat = get_theme_mod( 'activello_featured_cat' );
if ( $query->is_main_query() ) {
$query->set( 'cat', '-'.$slidecat );
}
}
}
add_action( 'pre_get_posts', 'exclude_category' );
Many thanks for the code, it works perfectly!
For the rest, I woukd like to create my own homepage. When I put this code in my homepage, thΓ© page is empty:
<div id="primary" class="content-area">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
<main id="main" class="site-main <?php echo "page-".$paged;?>" role="main">
<?php if ( have_posts() ) : ?>
<div class="article-container">
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', '' ); ?>
<?php endwhile; ?>
</div>
<?php activello_paging_nav(); ?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
I juste see the header, parts I’ve added and rhe slider.
Hope it is clear now π
You are most welcome π