Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #515782

    Hi!
    Im tryng to show a subtitle under the title (in flexible masonry post) in the home overlay.
    Im using plugin WP Subtitle, and with this previous answer, I succed showing in the inner post:
    https://kriesi.at/support/topic/subtitles-under-the-title/

    Now, how can I show in the overlay of the home section?

    I try something like this, but did not work (masonry_entries.php):

    if(strpos($this->atts['caption_elements'], 'title') !== false){
                            $markup = avia_markup_helper(array('context' => 'entry_title','echo'=>false, 'id'=>$entry['ID'], 'custom_markup'=>$this->atts['custom_markup']));
    						echo '<h4>the_subtitle();</h4>';
    						$items .=	"<h3 class='av-masonry-entry-title entry-title' {$markup}>{$the_title}</h3>";
    					}
    #516186

    Hi Victor!

    Thank you for using Enfold.

    Please edit line 609:

    $items .= 	"<{$html_tags[0]} id='av-masonry-".self::$element."-item-".$entry['ID']."' class='{$class_string}' {$linktitle} {$markup} data-sub='{$sub}'>";
    

    .. replace it with:

    $sub = '</h4>'.the_subtitle().'</h4>';
    $items .= 	"<{$html_tags[0]} id='av-masonry-".self::$element."-item-".$entry['ID']."' class='{$class_string}' {$linktitle} {$markup} data-sub='{$sub}'>";
    

    Add this in the Quick CSS field to display the subtitle on hover:

    #top .isotope-item:hover:before {
        content: attr(data-sub);
        display: block;
        width: 100%;
        height: 500px;
        position: absolute;
        top: 0;
        left: 0;
        color: red;
        transition: none;
        z-index: 1000;
    }

    Adjust the values if necessary.

    Cheers!
    Ismael

    #516289

    Thanks Ismael! But nothing happens yet..
    I add your code in masonry_entries.php
    and the css too… but still not showing the subtitle
    Any ideas?
    Thanks a lot!

    #516760

    Hey!

    The data-sub attribute should be added inside the #top .isotope-item container. Please check. Maybe, the plugin is not working. Please test if the $sub variable is not empty, try the var_dump function. A link to the actual page will help.

    Cheers!
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.