Make Portfolio Item Stick To The Top

On the page http://www.l2specialties.wordpresswebsitedesigns.org/projects/ , I want four specific portfolio items to always to at the top in the portfolio default sort with the rest after by date. Basically apply a sticky aspect to certain portfolio items. The portfolio is currently ordered by date.

How can I accomplish that?

Hi @allcal,

Thank you for reaching out to us. I believe this can be achieved with Essential Grid plugin please see https://www.themepunch.com/faq/always-show-featured-posts-first-in-your-grid/

As you see this requires custom development which is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer.

Thank you for understanding!

Well if anyone reads this and want to know the solution:

  1. Make your post sticky. If its a blog, feature is built in. For portfolio, add plugin Seamless Sticky Custom Post Types and make your porfolio item sticky.

2 Then add below to function.php so what is marked sticky will show on all pages at the top instead of just the home page because Wordpress is default only made to have sticky post show on the front page:

add_filter(‘the_posts’, ‘bump_sticky_posts_to_top’);
function bump_sticky_posts_to_top($posts) {
$stickies = array();
foreach($posts as $i => $post) {
if(is_sticky($post->ID)) {
$stickies[] = $post;
unset($posts[$i]);
}
}
return array_merge($stickies, $posts);
}

Hi again,

Your solution looks solid but the third party plugin you’ve used Seamless Sticky Custom Post Types is quite old and hasn’t been updated lately so this may cause issues / break customization in future with updates. Thank you for sharing the solution with us.

Take care and have a nice day!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.