-
AuthorPosts
-
May 5, 2016 at 1:12 pm #627786
Hi team,
I’m a developer working on a site for client and I needed to extend the masonry entries shortcode just a bit to include some additional fields to event post type, so I followed your instructions on creating a folder for shortcodes in child theme’s folder, copied over the masonry-enties.php, gave it a different name and modified the file to do it’s job, which all worked great, the result can be seen here:
The problem appeared when I created a page that uses vanilla masonry-entries shortcode for blog posts, for some reason, ajax that fetches more posts does not work. My guess would be the ajax for vanilla shortcode is somehow hijacked by my modified one. I’ve been trying to make sense of it, but I though you’d be able to point me in the right direction which would save a lot of time.
Here is the page with blog posts, there are dozens of posts in the database, but the page only loads first 6 and then on ajax fetch it returns empty:Thanks!
- This topic was modified 8 years, 7 months ago by narasopa.
May 9, 2016 at 3:45 am #628968Hey narasopa,
Thank you for using Enfold.
We checked the links above but we get an “ERROR 502 – BAD GATEWAY” notification. Where did you add the modifications? What lines? You can use the “avf_masonry_loop_prepare” filter to add more content to the masonry items without modifying the actual shortcode. Example here: https://kriesi.at/support/topic/inject-category-name-into-masonry-element/#post-617984
Best regards,
IsmaelMay 10, 2016 at 4:20 pm #630039Hi Ismael,
Thank your for your reply.
I meant to send you a diff comparison of my modified shortcode, but then I noticed the difference between the defualt masonry-entries and my own file is huge – because I was using the original file from previous version of Enfold as basis for modification. When I updated the theme, masonry-entries.php changed a lot and is quite smaller now.
I scrapped my old modified shortcode and I’ll use the filter to alter the output and add those custom fields I need. This will solve my initial problem, as now loading new posts with ajax works OK across the site.
However there is one thing that still bugs me and it would be great if you could point me in the right direction. Since I’m using this modified output to display Events custom posts, I need the query to order the posts using post meta argument (start date of the event). What would be the easiest way of adding this to the query?
Thanks!
EDIT:
Nevermind, I worked something out by copying helper-masonry.php to child theme shortcode folder and creating a new class for modified masonry-entries. It got the job done :)
Thanks for all your help
- This reply was modified 8 years, 7 months ago by narasopa.
May 12, 2016 at 6:24 am #631151Hi,
Great! Glad you sorted it out. I’m not sure if you can sort the events by the actual “event date” so a workaround is to set the “Order By” parameter to “Page Order”. You can then sort the events manually by using the “Order” field. Related link: https://kriesi.at/support/topic/masonry-gallery-ascending-order-on-date/#post-625571
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.