Tagged: sticky posts
-
AuthorPosts
-
November 27, 2014 at 6:46 pm #359119
Hi team,
I noticed that sticky posts are kept at top for a “normal” blog layout but not for grid and masonry layouts.
Is this really inteded or a bug?Regards
MartinNovember 28, 2014 at 6:07 pm #359700Hi taikuli!
Yes that is intended. Sticky posts are not compatible with sorting. You can change the query on line 879 in /enfold/config-templatebuilder/avia-shortcodes/masonry-entries.php from this.
$query = array( 'orderby' => 'date', 'order' => 'DESC', 'paged' => $page, 'post_type' => $params['post_type'], 'post_status' => 'publish', 'offset' => $params['offset'], 'posts_per_page' => $params['items'], 'tax_query' => array( array( 'taxonomy' => $params['taxonomy'], 'field' => 'id', 'terms' => $terms, 'operator' => 'IN')));
To this.
$query = array( 'post_type' => $params['post_type'], );
But that will disable a lot of Masonry features.
Best regards,
Elliott- This reply was modified 9 years, 11 months ago by Elliott.
November 29, 2014 at 10:42 pm #360148Hm, no that change doesn’t help.
In fact I tried to break this function by adding a function call to eieie() (which I assume is nonexistent) and the Homepage still loads.
Hm.I tried the Blog Element and the grid layout. It also does not respect sticky posts.
“single author” respects the sticky posts.November 29, 2014 at 10:45 pm #360149btw. I just noticed, the blog element “single author” shows sticky posts twice.
on the first page and later on mixed into normal posts according to their creation time.December 1, 2014 at 3:01 am #360534Hi!
I’m sorry but this is not possible without creating another query for the sticky posts on the config-templatebuilder > avia-shortcodes > masonry_entries.php file. Can you please provide a link to the single author blog posts with the sticky posts issue? We tested this on our installation and it’s only showing the sticky post once.
Cheers!
IsmaelDecember 1, 2014 at 9:17 am #360662Take a look at http://gwl.wirsindtennis.de/ and check the single author layout on the bottom of the page.
Two sticky posts are displayed first and also displayed on the second page.They are not doubled on http://gwl.wirsindtennis.de/blog/, but there is no paging.
December 2, 2014 at 4:54 am #361278Hi!
You can add this on functions.php so that the blog query will ignore sticky posts:
/** * Blog Query */ add_filter( 'avia_blog_post_query', 'avia_modify_blog_query', 10, 1); function avia_modify_blog_query( $query ) { $add_query = array('ignore_sticky_posts' => 1); $query = array_merge($add_query, $query); return $query; }
I’ll ask Kriesi to take a look. Maybe, he can improved the query to include sticky posts.
Best regards,
IsmaelDecember 2, 2014 at 10:48 pm #361829Hi, I noticed that sticky posts are listed twice only if paging is enabled.
off topic: Maybe you also want to take a look at the separators for the posts metadata. I have disabled all but the Publishing date.
Now it displays the publishing date plus a superfluous slash. Example: 27 November 2014/December 7, 2014 at 8:56 am #364253Hey Martin!
Try adding this code to the Quick CSS:
span.text-sep.text-sep-date { display: none; }
Cheers!
JosueJuly 1, 2016 at 5:51 pm #655866We just ran into this as well. Need to display the post grid and have stickies at the beginning. Not even sure ho I can hack it to get both in the same place. In this case, a city needs an official notice to stay at the front of the list for 6 weeks. Not sure why it is not possible, as it is part of the basic WP themes. Otherwise, people with these needs have to either give up a nice, ordered system, or make a separate grid area and have a bunch of awkward space (trapped white space).
Why can’t there be a checkbox to search first sticky posts, then display remainder in selected order?
July 5, 2016 at 3:44 am #656803Hi,
I’m sorry but you cannot display sticky posts in the grid layout. It’s possible but you have to create another query in the postslider.php file which is something that we won’t be able provide here. A workaround is to add a unique category to the sticky posts, add another blog posts element then select the category.
Best regards,
IsmaelooSeptember 27, 2016 at 5:45 am #692060Hey!
UPDATE for @Jason E.
Please try the solution here: https://kriesi.at/support/topic/sticky-posts-in-b-og-grid/#post-692059
Regards,
IsmaelSeptember 28, 2016 at 7:26 am #692506Thank you very much for this! The site we were going to use this for is using a different solution at the moment, but I am eager to try this on our testing site within the next week or so. Thank you for developing this.
It would be really cool to put this in the code snippets section, as it could be helpful to many developers
Thanks again!.
September 28, 2016 at 9:53 am #692534 -
AuthorPosts
- The topic ‘Sticky posts in grid and masonry layouts’ is closed to new replies.