Tagged: category, masonry blog
-
AuthorPosts
-
October 11, 2017 at 9:30 pm #863029
Good day. I have purchased your theme over 10 times for my clients. Best theme ever. I have 2 questions I can hope you can help with.
#1) I would like to add the category name to the masonry blog main page like on this page:
So under the title for each blog post on the main blog page, I want the category name to be appear. For example, in the URL above, I want the category name to appear under “New electric cars are getting really fast” and “Cryptocurrencies are booming” and so on. For all the blog posts.
I know that section already has the title, excerpt, and date. But now I want it to show category name under the title.
Is that possible? I also want to style it, like maybe change the color. But I can do that myself with CSS. From you I need the ability to add it before I can style it.
#2) Also on the Masonry Blog main page, one of the filters says “All”. Where can I change that text? I would like it to say “All Articles”
Thank you!
- This topic was modified 7 years, 2 months ago by santanin.
October 12, 2017 at 7:08 am #863217Hey santanin,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Best regards,
John TorvikOctober 12, 2017 at 3:02 pm #863459This reply has been marked as private.October 13, 2017 at 3:24 pm #863983Hi santanin,
Please refer to this thread for a possible solution.
If you need further assistance please let us know.
Best regards,
VictoriaOctober 13, 2017 at 4:39 pm #864052Hello. I read through that thread and do not understand. Which of my 2 issues will that help? And what exactly do I do? I need to replace the value of the “is_page” function and the slug value for “whats-new”?? What do I replace it with?
October 16, 2017 at 9:24 pm #864945Hi I replied to you 3 days ago but no response. Please help and why no respond? Please respond and help. Thank you to you.
October 17, 2017 at 3:30 am #865056Hi,
I’m sorry for the late response. Please add this filter in the functions.php file.
add_filter( 'avf_masonry_loop_prepare', 'avf_masonry_loop_prepare_mod_cat', 10, 2 ); function avf_masonry_loop_prepare_mod_cat( $key, $entries ) { $categories = get_the_category($key['ID']); $separator = ' '; $output = ' <div class="ww-masonry-cat">'; if ( ! empty( $categories ) ) { foreach( $categories as $category ) { if($category->slug == "whats-new" && is_page(13)) { $output .= '<span alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</span>' . $separator; } else { $output .= '<span alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</span>' . $separator; } } } $output .= '</div> '; $key['text_before'] .= trim( $output, $separator ); return $key; }
You can also try the following solution if the filter above is not working: https://kriesi.at/support/topic/display-the-post-category-above-the-title-in-masonry-view/#post-660247
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.