Hello,
Sorry but we have not tested sticky posts with any of our theme blocks so we cannot provide a solution in this regard. you will need to hire a freelancer to help out with the code needed as we cannot offer any customization services at the moment.
Thank you!
OK. It would be good to have this feature in your theme.
However, I had an idea for a workaround, which was to set the date of the ‘sticky’ post to a date a long time in the future so it’s always the newest.
However, by default, wordpress then makes this a scheduled post.
So, I found this piece of code to over-ride that and publish it now:
//make future post date visible now
function onetarek_prevent_future_type( $post_data ) {
if ( $post_data['post_status'] == 'future' && $post_data['post_type'] == 'post' )#Here I am checking post_type='post' , you may use different post type and if you want it for all post type then remove "&& $post_data['post_type'] == 'post'"
{
$post_data['post_status'] = 'publish';
}
return $post_data;
}
add_filter('wp_insert_post_data', 'onetarek_prevent_future_type');
remove_action('future_post', '_future_post_hook');
This does what I need it to. Thanks all the same
-
This reply was modified 7 years by
3ftDeep.
Just as a follow up on this, if anyone else wants to do the same thing:
To ‘fake’ a sticky post in the mega menu (make specific posts always appear first in the mega menu), this is part of my workaround;
Create a post with a far future publish date (I used year 2500) but using the code above in functions.php to publishes it rather than scheduling.
This post then appears first in megamenu in date order.
I then had to place the ‘post masonry grid’ within this post via VC so it acted like a category. The post grid element for VC allows you to select a category for the post grid. Once set, I also had to exclude the main post I created from the grid as it was displaying code in the excerpt; some sort of odd ‘post in a post’ loop.
I actually wanted 4 specific posts to always display in the mega menu so I adjusted the far future date of each by a year so they would always appear first and in order.
Hope this might interest someone else.
Not perfect, but it does what I needed.
Hi! I’ve found this post and it’s sort of what I need as well.
Actually, I wish I could set the order of my articles on the mega menu just like we do now on other sections of newspaper theme (where we can filter by article number, newest, etc)
I’ll leave it as a suggestion for future updates in Newspaper. Thanks!
Hi,
If you want you can try the new version of Newspaper, there are more options now, if you want to test it please test it first on localhost or on sub-domain
-> https://tagdiv.com/whats-new-in-newspaper-theme-9-5-update/
Thank you!
Hi! Ah that’s a pity, that’s excactly what I need, too.
Might you provide a child theme code snippet – to filter mega menu posts by alphabetic order?!
This functionality is available for mostof the other blocks – so I hope it will come for mega menu in a future update soon ;). Thanks!
Hi @cobelfret,
Unfortunately for the moment the filter is not available for mega menu, maybe this will be implement in coming updates.
Thank you!