-
AuthorPosts
-
September 14, 2024 at 9:24 am #1466954
Hi!
I would like to know if it is possible to achieve the following:
I activated the post formats for portfolio items by adding the following code to the functions.php file of my enfold child theme.function add_post_formats_to_portfolio() {
add_post_type_support(‘portfolio’, ‘post-formats’);
}
add_action(‘init’, ‘add_post_formats_to_portfolio’);I’m using a page to show portfolio items that contain a masonry, and I want the icons relating to each type of post format to appear, as in normal publications.
Is it possible?Thank you!
September 16, 2024 at 5:34 am #1467048Hey luismiguelsantos,
Thank you for the inquiry.
Would you mind providing a screenshot of the changes that you’d like to implement and provide a link to the page? You can use platforms like Savvyify, Imgur or Dropbox to upload and share the screenshot.
Best regards,
IsmaelSeptember 16, 2024 at 9:37 am #1467063Dear Ismael,
The site has a news page (with normal posts) where you can see the first two posts with the format “video” and “quote”. They have the icons on top of the image.
What I want is for the icons for each type of format to appear on the “testimonials” page (with portfolio items).
As I said, I activated post formats for portfolio items, but the icons do not appear.
You can see it here: https://dev.triton.pt/bialall/
Thank you
September 17, 2024 at 5:13 am #1467164Hi,
Thank you for the update.
You can try the following filter in the functions.php file. Make sure to replace the image path with your own.
function avf_masonry_entry_title_mod( $the_title, $entry, $atts ) { $post_format = get_post_format( $entry['ID'] ); $icon_url = ''; switch ( $post_format ) { case 'video': $icon_url = 'path/to/video-icon.png'; break; case 'audio': $icon_url = 'path/to/audio-icon.png'; break; case 'gallery': $icon_url = 'path/to/gallery-icon.png'; break; default: $icon_url = 'path/to/default-icon.png'; break; } $the_title .= " <span class='av-masonry-icon'><img src='{$icon_url}' alt='post-format-icon' /></span>"; return $the_title; } add_filter( 'avf_masonry_entry_title', 'avf_masonry_entry_title_mod', 10, 3 );
Best regards,
IsmaelSeptember 17, 2024 at 5:23 pm #1467217Hi,
It works, thank you.One last question:
How can I change the colour of the text that is exactly beneath the title?
It’s not the full text, just the one that is under the title.I tried HTML markups, but they don’t work on (entry-content).
I need:
• Title (White)
• Subtitle (red)
• Text (white)
Thank you for your help.September 18, 2024 at 4:10 am #1467250Hi,
Thank you for the update.
We can only target either the title or the whole content. If you want to target a specific line of text, make sure to wrap it inside a unique container or element. Example:
<p class="av-text-red">AMCHAM</p>
You can then apply the color to the av-text-red element.
.av-text-red { color: red; }
Best regards,
IsmaelSeptember 18, 2024 at 3:31 pm #1467327Hi!
I manage to resolve the issue with this: https://kriesi.at/support/topic/add-a-custom-field-in-the-masonry-post-blog-list-element/Thank you very much for your help.
You can close this.
September 19, 2024 at 6:57 am #1467419 -
AuthorPosts
- The topic ‘Portfolio items and Format posts’ is closed to new replies.