How to Implement a Sticky Post on my Blog Page?

#1
Hi Guys, there wasn't anything here on the new forum about sticky posts. Ideally, it would be great if we could just make a blog post sticky— but apparently, it's not that easy.

@eric If it's not all ready there, could a Sticky-Post feature be added to a future update? I hope so!

I did find a few threads on the old forum to make a post sticky— You know, stay on top of the blog as an introduction of sorts.

A 2015 entry on the old forum offers the following script solution to set up a Sticky Post.

Code:
// For sticky blog?

genesis_register_sidebar( array(
    'id'        => 'text-before-blog',
    'name'      => 'Text Before Blog',
    'description'   => 'This is the widget for displaying text before blog posts.',
) );
 
add_action('genesis_before_content', 'apparition_text_before_blog' );
function apparition_text_before_blog() {
 
    if( is_page(XXXXXXX) ) {
        echo '<div class="text-before-blog">';
            dynamic_sidebar( 'text-before-blog' );
        echo '</div>';
    }
}
All you have to do ito go this route is change the page number (where the XXs are.)

Then further down in the thread someone points out that this can be achieved by creating a 'widget area' in dynamic custom with a conditional applied, and then easily hooked into 'genesis before content,'

Yes, using the custom widget area and conditional would allow me to re-use it for another post into it in the future. But, what would I do with the content of the original sticky posts? Rather than appearing back in the chronological place that it belongs in the blog, I'd have to delete it— which is terrible for SEO.

Thanks
 

eric

Administrator
Cobalt Apps Developer
#2
Yes, you can do this with the Custom Widget Areas and Conditionals in DWB -> Custom. Then you could just add a specific blog post using the Genesis Featured Posts Widget. The part I'm confused about is where you say that you'd then need to delete the post? Can you clarify that for me?
 
#3
Hi Eric,

Yes, that's what I thought, and that's conditionals are such a powerful tool! Sorry, the "need to delete the post" thing was a bit of time warped brain-fog.

In the old days, probably before you ported over to gensis, I had to write out the post out a text widget to make a sticky post. I am using the Genesis Featured Page Advanced Plug-in but haven't used it to format a full post as of yet, just excerpts.

Thanks for shining some light on my foggy mind.

Cheers