• donkeydigest

    (@donkeydigest)


    Hey there! Hoping someone can guide me here:

    What I’m trying to do:

    • Using Elementor Free’s Grid Block widget to display blog posts
    • Need Position 1 in the grid to stay constant (sticky/pinned post)
    • Positions 2-9 should show the most recent posts ordered by date (descending)
    • When new posts are published, they appear in positions 2-9 and push older posts down
    • Position 1 stays the same until I manually choose to replace it (by removing the sticky)

    Current setup:

    • Grid Block showing 9 posts from “All Music Reviews” category AND either ‘Single Reviews’ or ‘Album Reviews’ categories
    • Sort By: Published Date (descending)
    • The sticky post I want in Position 1 is also in “All Music Reviews” AND ‘Single Reviews’ categories plus “Obsession” category

    What I’ve tried:

    • WordPress sticky posts feature (checked “Stick to the top of the blog”) but Grid Block doesn’t respect it
    • Custom code filters (pre_get_posts, elementor/query hooks) with no success
    • Grid Block doesn’t have built-in sticky post options

    What I need:

    • A way to make Elementor Free’s Grid Block respect WordPress sticky posts, OR
    • Alternative solution within Grid Block to keep one specific post in Position 1 while others sort by date

    Important constraints:

    • Must use single Grid Block (cannot use multiple grid blocks)
    • Site publishes 3-4 posts daily, so manual solutions like changing post dates are not feasible

    Version info:

    • Elementor Free
    • Widget: Grid Block

      THANK YOU IN ADVANCE!

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Pouya

    (@pouyaebrhm)

    Elementor’s Grid Block (Free version) does not respect WordPress sticky posts by design. So unfortunately there’s no native setting to keep one post fixed at position 1.

    You have 3 possible approaches:

    1) Use Elementor Pro → Custom Query ID (cleanest solution)
    2) Use two separate grids (one sticky + one latest posts)
    3) Or modify the query via custom PHP (advanced solution)

    If you’re comfortable with custom code, I can share a PHP snippet that forces sticky posts to appear first using pre_get_posts.

    Thread Starter donkeydigest

    (@donkeydigest)

    Hey Pouya – I’d appreciate that! Thanks!

    Pouya

    (@pouyaebrhm)

    Sure 🙂 here’s a clean way to handle it.Since Elementor’s Grid Block doesn’t respect WordPress sticky posts by default, we can modify the query and force sticky posts to appear first. If you’re comfortable adding a small PHP snippet, add this to your theme’s functions.php (or a Code Snippets plugin):

    /**
    * Elementor Grid Block – force sticky post to stay first
    * Position 1 = sticky
    * Positions 2+ = latest posts by date DESC
    */

    add_action( 'elementor/query/posts', function( $query ) {

    // Get WordPress sticky posts
    $sticky_posts = get_option( 'sticky_posts' );

    if ( ! empty( $sticky_posts ) ) {

    // Include sticky posts and show them first
    $query->set( 'post__in', $sticky_posts );

    // Order: sticky first, then newest posts
    $query->set( 'orderby', [
    'post__in' => 'DESC',
    'date' => 'DESC',
    ] );
    }

    });

    This forces:

    • Position 1 → sticky post
    • Positions 2+ → newest posts by date

    Works with a single grid and updates automatically when you publish new posts.

    If your grid uses a custom Query ID, replace “posts” with that ID.

    Thread Starter donkeydigest

    (@donkeydigest)

    Hey thanks! I don’t think it worked. Added the snippet. Then as a test, I went to a post that’s a week old, made it sticky, and the expected behavior was it would then be to the first position on the grid, but i wasn’t. 🙁

    Pouya

    (@pouyaebrhm)

    Thanks for testing it — your test makes sense 👍
    The reason it didn’t work is that Elementor’s Grid Block doesn’t use the generic
    elementor/query/posts hook. You need to use a custom Query ID so Elementor knows which query to modify.

    Here’s the correct approach:

    1) In the Grid Block settings:

    • Go to Query → Advanced
    • Set Query ID to: highlight_grid

    2) Then add this PHP snippet:

    /**
    * Elementor Grid Block
    * Force sticky post to always stay in position 1
    * Requires Query ID = highlight_grid
    */
    add_action( 'elementor/query/highlight_grid', function( $query ) {

    $sticky = get_option( 'sticky_posts' );

    if ( empty( $sticky ) ) {
    return;
    }

    // Put sticky post first
    $query->set( 'post__in', $sticky );
    $query->set( 'ignore_sticky_posts', true );

    // Order remaining posts by date
    $query->set( 'orderby', [
    'post__in' => 'DESC',
    'date' => 'DESC',
    ] );
    });

    This way:

    • Position 1 = sticky post
    • Positions 2+ = latest posts by date
    • Making an old post sticky will immediately move it to position 1
    • Removing sticky restores normal ordering

    Elementor Free doesn’t support this out of the box, so this is the cleanest solution.

    Thread Starter donkeydigest

    (@donkeydigest)

    Grrr! Still striking out:

    Older post designated as ‘sticky.’
    Proper category selected.
    code in php snippet and live
    Query ID to: highlight_grid
    (actually, in my install it’s edit grid -> Content -> Devs: Query ID

    And many thanks for helping with this.

    Pouya

    (@pouyaebrhm)

    Hi, thanks for checking and for the details.

    This isn’t something you’re doing wrong. The Elementor Grid Block doesn’t use the normal elementor/query/posts hook, so PHP snippets can’t change its ordering. That’s why sticky posts are ignored even though everything looks correct on your side.

    In Elementor Free, the Grid Block query is internal and can’t be modified to force a sticky post into position 1.

    Unfortunately, the only reliable options right now are:

    • Manually selecting the highlight post, or
    • Using Elementor Pro (custom query), or
    • Building a small custom loop/block.

    So this is a limitation of the widget, not a config issue.

    • This reply was modified 1 month ago by Pouya.
    Thread Starter donkeydigest

    (@donkeydigest)

    “Manually selecting the highlight post,” – I don’t mind doing that, but how do you keep it in the first position.

    and are you certain the paid version will do what’s needed if I pick that option?

    thanks!

    Pouya

    (@pouyaebrhm)

    1) Manually selecting the highlight post
    With the Grid Block (Free), you actually can’t lock a post into position 1. You can select it, but the widget will still reorder everything by date. So manual selection alone won’t keep it first.

    2) Elementor Pro
    Yes — in Pro this is possible. You can use a Custom Query / Query ID and explicitly place one specific post first, then load the rest ordered by date. That’s exactly the use case Pro’s query hooks are meant for.

    So to be clear:

    • Free → not possible to reliably keep position 1
    • Pro → yes, doable with a custom query

    Hope that clears it up.

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.