How to display a sticky post inside a div?

You could simply follow the example from the Codex: $sticky = get_option( ‘sticky_posts’ ); $query = new WP_Query( ‘p=’ . $sticky[0] ); The variable $sticky will hold an array of IDs, and you access the first sticky post via $sticky[0]. Then you need the WordPress Loop: if ( $query->have_posts() ) { while ( $query->have_posts() ) … Read more

Make posts non-sticky

You can use a simple script which you run once and remove. The idea is to replace the sticky post array with an array of the 4 desired ID’s PHP 5.4+ version – short array syntax add_action( ‘init’, function () { // Define our new array $stickies = [1,2,3,4]; // Change to match your own … Read more