Exclude Sticky Posts as everyone!

I'm trying to exclude 3 Sticky posts from my blogs loop, I tried some snippets of code, but with no success. I could use some help.

?php if ( $posts-have_posts() ) : ?
?php /* Start the Loop */ ?
?php while ( $posts-have_posts() ) : $posts-the_post(); ?
?php get_template_part( 'content', get_post_format() ); ?
?php endwhile; ?
div class=clearfix/div
?php else : ?
?php get_template_part( 'content', 'none' ); ?
?php endif; ?
div class=clearfix/div
?php $wp_query = new WP_Query($args); global  $wp_query; if ($wp_query-max_num_pages != 1) { ?

Topic sticky-post Wordpress

Category Web


If you want to exclude sticky posts then you can use it.

<?php
$args = array(
    'posts_per_page' => 10,
    'ignore_sticky_posts' => 1
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();
?>

For More details:

https://www.wpbeginner.com/wp-themes/how-to-exclude-sticky-posts-from-the-loop-in-wordpress/

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.