Tagged: 

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #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
    Martin

    #359700

    Hi 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, 12 months ago by Elliott.
    #360148

    Hm, 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.

    #360149

    btw. 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.

    #360534

    Hi!

    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!
    Ismael

    #360662

    Take 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.

    #361278

    Hi!

    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,
    Ismael

    #361829

    Hi, 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 /

    #364253

    Hey Martin!

    Try adding this code to the Quick CSS:

    span.text-sep.text-sep-date {
        display: none;
    }

    Cheers! 
    Josue

    #655866

    We 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?

    #656803

    Hi,

    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,
    Ismaeloo

    #692060

    Hey!

    UPDATE for @Jason E.

    Please try the solution here: https://kriesi.at/support/topic/sticky-posts-in-b-og-grid/#post-692059

    Regards,
    Ismael

    #692506

    Thank 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!.

    #692534

    Hey!

    No problem. Please feel free to open a new thread if you encounter any issue. :)

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Sticky posts in grid and masonry layouts’ is closed to new replies.