-
AuthorPosts
-
November 28, 2018 at 6:00 pm #1038643
I have a search function where the visitor can search posts by combining categories and also free textsearch.
I put those parameters into a query that returns the posts that matches the search.
I convert those posts to a string of ids that I put into a shortocde like the one below.[av_masonry_entries ids='1662,1621,135,1232,'1456' ]
I has been working splendid, but it doesnt work anymore, it seems like the shortocde handler ignore the shortcodeattribute “ids” , because it retrurns all posts not only those whot match the search.
I cant find anything in the supportfoum or in the documentation that will help me, can you?
Regards Johan
November 28, 2018 at 6:25 pm #1038657I have checked so the string with the ids is correct, the search working and correct ids are returned.
November 28, 2018 at 8:10 pm #1038696Hi,
Did you need further help or shall we close this topic?
Best regards,
Jordan ShannonNovember 29, 2018 at 10:53 am #1038880I need help to get the masonry shortcode work se my first psot, it ignores the ids .
December 4, 2018 at 12:07 pm #1040685Any ideas about my problem?
December 4, 2018 at 12:27 pm #1040689Hi,
You can only specify the “ids” attribute when you’re using the Masonry Gallery element or when you’re working with attachments/images. It’s not going to work with posts.
Example:
[av_masonry_gallery ids='3503,3488,3591,3368' items='24' columns='flexible' paginate='pagination' size='flex' orientation='' gap='large' overlay_fx='active' animation='active' container_links='active' id='' caption_elements='title excerpt' caption_styling='' caption_display='always' color='' custom_bg='' av-medium-columns='' av-small-columns='' av-mini-columns='' av_uid='av-jp9l3263' custom_class='']
However, it’s still possible to display items based on post ids by using the “avia_masonry_entries_query” filter.
add_filter('avia_masonry_entries_query', 'avia_masonry_entries_query_mod', 10, 2); function avia_masonry_entries_query_mod($query, $params) { $query['posts__in'] = array( 2, 5, 12, 14, 20 ); return $query; }
Best regards,
IsmaelDecember 4, 2018 at 3:18 pm #1040743OK, but it has been woking before.
I will check out your solution.December 4, 2018 at 3:20 pm #1040744Its not [av_masonry_gallery] I use, its [av_masonry_entries] , but maybe that wont change anything?
December 5, 2018 at 5:58 am #1041074 -
AuthorPosts
- You must be logged in to reply to this topic.