Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #334487

    Hi,

    On my web page http://www.abundantforever.com/topics/topics/ I used the fullwidth masonry. At this moment, when I put my mouse on the image, the post title pops up, but that is already visible in the caption. I would like to change that to the post excerpt. How can I do that?
    Also the height of image caption is dynamic and depends on the length of the post title. I want the height to always be minimal 2 lines high but still by dynamic in case 3 or more lines are required. This will make the caption height the same on all images. The text should be vertically centered.
    Could you tell me how to do that?
    Thanks,

    Stephen

    #334683

    Hi stephenr_nl!

    Thank you for using Enfold.

    The title popup is default browser feature. You can replace the image title manually on Media > Library panel. Or you can edit config-templatebuilder > avia-shortcodes > masonry_entries.php. Find this code on line 578:

    $items .= 	"<{$html_tags[0]} class='{$class_string}' {$linktitle} {$markup}>";
    

    Replace it with:

    $items .= 	"<{$html_tags[0]} class='{$class_string}' title='{$content}' {$markup}>";
    

    Make sure that you keep a change log of this modification or use a child theme.

    Cheers!
    Ismael

    #334788

    Hi Ismael,

    Thanks you for your response. I am using a child them, but I don’t know what to add to my functions.php file to just replace this parameter value. I was thinking something like the code below (which does not work). Can you assist?

    /*Replace the image title on the full Masonry*/
    function masonry_image_title() {
    if($post_type == ‘attachment’ && strpos($html_tags[0], ‘a href=’) !== false)
    {
    $linktitle = ‘title=”‘.esc_attr($description).'”‘;
    }
    else if(strpos($html_tags[0], ‘a href=’) !== false)
    {
    $linktitle = ‘title=”‘.esc_attr(‘test’).'”‘;
    }

    return $linktitle;
    }

    #335371

    Hey!

    Please add this on the child theme’s functions.php:

    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths)
    {
    $template_url = get_stylesheet_directory();
    array_unshift($paths, $template_url.'/shortcodes/');
    
    return $paths;
    }

    Create a folder called shortcodes then add the masonry_entries.php inside.

    Regards,
    Ismael

    #335778

    Thank you Ismael, this worked perfectly. Eventually I want a more enhanced method to display the excerpt and I added a feature request for that: “Option for Masonry to always show title and on mouse over add the excerpt”.
    You guys are giving excellent support and I recommend my friends to use this same theme because of that and of course because the theme is beautiful.
    So thanks again.

    Stephen

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Full width Masonry, change the image title and caption height’ is closed to new replies.