Tagged: ismael
-
AuthorPosts
-
April 18, 2017 at 12:44 pm #779236
Hi there,
I’ve tried adding the following code to my functions.php to display the category in the masonry blog posts but it isn’t showing up.add_filter( 'avf_masonry_loop_prepare', 'avf_masonry_loop_prepare_mod', 10, 2 ); function avf_masonry_loop_prepare_mod( $key, $entries ) { $class = preg_grep('/category/', $key['class']); $getstr = str_replace('category-', '', implode(',', $class)); $categories = explode(',', $getstr); $cat = implode(',', array_map('ucfirst', $categories)); foreach ( $key as $post => $value ) { if ( $post == 'content' ) { $value .= "<div class='av-masonry-categories'>".$cat."</div>"; } $key[$post] = $value; }
Thank you
April 18, 2017 at 3:42 pm #779390Hey 3mil-pedro,
Could you please give us a link to your website and a page where you’re trying to do this, we need more context to be able to help you.
Best regards,
VictoriaApril 18, 2017 at 4:39 pm #779462Hi Victoria,
Sure – posted below.
Thank you
April 19, 2017 at 10:45 am #779888Hi 3mil-pedro,
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,
VictoriaApril 19, 2017 at 2:57 pm #779983Hi Victoria,
Absolutely, please find the details below.April 20, 2017 at 1:31 pm #780519Hi,
The credentials did not work. Please update them.
Best regards,
VictoriaApril 20, 2017 at 2:47 pm #780549Hi Victoria,
Thanks – can you try now?Thank you
April 24, 2017 at 9:50 am #782206Hi guys,
Any suggestions on this?
Thank you
April 25, 2017 at 6:41 am #782667Hi,
I’m sorry for the late response. Please use the suggested filter in the following thread instead.
// https://kriesi.at/support/topic/4-0-2-masonry-no-longer-display-the-right-category/#post-763505
Best regards,
IsmaelMay 11, 2017 at 1:49 pm #791634Hi Ismael,
Thank you – this works great, it doesn’t appear to get the category for the portfolio items though.
May 12, 2017 at 11:30 am #792217Hi 3mil-pedro,
It does not work for portfolio, because portfolio class looks like this “av-masonry-entry isotope-item post-8460 portfolio type-portfolio status-publish has-post-thumbnail hentry portfolio_entries-charity portfolio_entries-client-stories portfolio_entries-healthcare all_sort charity_sort client-stories_sort healthcare_sort av-masonry-item-with-image av-masonry-item-loaded”. So you have to add to this function the case for portfolio_entries-.
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.