Tagged: Sticky post
-
AuthorPosts
-
December 9, 2018 at 1:46 am #1042636
Just created a sticky post after updating to WordPress 5 and it’s not showing up on the top of my blog page.
Any ideas?- This topic was modified 5 years, 11 months ago by Jagrav. Reason: Correcting word phrasing
December 10, 2018 at 7:32 pm #1043276Hey Jagrav,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaDecember 10, 2018 at 8:58 pm #1043333temporary admin access
December 16, 2018 at 5:05 pm #1045976Hi Jagrav,
Thank you for that.
Which post are you referring to? I do not seem to find the sticky post.
Best regards,
VictoriaDecember 17, 2018 at 4:29 am #1046134Thanks Victoria,
The sticky post is titled “Introduction” and should appear at the top of the blog page named “And This Too.”
I designated the blog page in Dashboard: Enfold >
Theme Options
And where do you want to display the Blog?:
“And This Too” page.There are two places to set the blog page
1) Enfold > Theme Options >
And where do you want to display the Blog?
And This Too2) WP Admin: Settings > Reading >
Your homepage displays
Homepage: Home
Posts page: –Select– (And This Too)Sticky post does not work with just “Enfold Theme Options”pointing to the blog.
With “Enfold Theme Options” and “WordPress Settings > Reading>Posts page” designated I lose the Enfold display settings: single author, small preview pic (no author picture is displayed, featured image is small)
I resorted to having both designating blog page settings on and setting the blog page date/time to be newer than all my other posts.
Would be nice to have less of a work-around :)
December 19, 2018 at 10:29 am #1047125Hi,
Thank you for using Enfold.
Did you set the blog layout to “Use the advance layout builder..”? This filter might help:
// sticky posts add_filter('avia_blog_post_query', 'avia_blog_post_query_mod', 10, 2); function avia_blog_post_query_mod($query, $params) { $include = array(); $sticky = get_option( 'sticky_posts' ); $args = array( 'taxonomy' => $params['taxonomy'], 'post__not_in' => $sticky, ); $posts = get_posts( $args ); foreach($posts as $post) { $include[] = $post->ID; } $include = array_merge($sticky, $include); // convert values of the $include from string to int function sti($n) { settype($n, 'int'); return $n ; } $include = array_map("sti", $include); $query['post__in'] = $include; $query['posts_per_page'] = 6; $query['orderby'] = 'post__in'; // sort items based on the post__in value return $query; }
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.