Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #996298

    Hi,

    How can I display the copyright information on each photo within a Enfold Gallery?

    Kind regards,
    Roger – EZ Webdesign

    #996417

    Hey Roger,

    The gallery element does not display the copyright information by default. However you could i.e. add the copyright information to the caption/popup tooltip by replacing line 320 in enfold\config-templatebuilder\avia-shortcodes\gallery\gallery.php

    
    $caption = trim($attachment->post_excerpt) ? wptexturize($attachment->post_excerpt) : "";
    
    

    with

    
    $caption = trim($attachment->post_excerpt) ? wptexturize($attachment->post_excerpt) : "";
    
    $copyright_text = get_post_meta($attachment_id, '_avia_attachment_copyright', true );
    
    if($copyright_text) $caption .= ' ' . $copyright_text;
    

    Best regards,
    Dude

    #996433

    Hi Dude,

    Thanks for your answer. I understand your code change, but in that case it’s easier then when I simply put the copyright information in the Title or Caption fields.

    Best regards,
    Roger

    #996445

    Hi!

    Yes, it’s only useful if you already use the copyright fields…

    Regards,
    Peter

    #1165865

    Hi Dude

    I’ve inserted the code referenced above but the copyright is still not showing. Please take a look. See https://beautifullaos.org/northern-provinces/725-2/ for the horizontal gallery.

    Thanks
    Janine

    #1166636

    Hi,


    @jwencke
    : For the horizontal gallery, you have to modify the \enfold\config-templatebuilder\avia-shortcodes\gallery_horizontal\gallery_horizontal.php file, look for this code around line 512:

    $output .= "width='{$img[1]}' height='{$img[2]}' src='{$img[0]}' title='" . esc_attr( $title ) . "' alt='" . esc_attr( $alt ) . "' />";	
    

    Below, add this code:

    $copyright_text = get_post_meta($attachment->ID, '_avia_attachment_copyright', true );
    if($copyright_text) $output.= '<span class="copyright">' . $copyright_text . '</span>';
    

    You may need to add a few css code to adjust the style of the copyright text.

    Best regards,
    Ismael

    #1167176

    Thanks Ismael!

    #1167963

    Hi jwencke,

    Glad we could help :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1275123

    This is all very helpful. How do I add the copyright info into the avia content slider?

    #1275410

    Hi,


    @connect4consulting
    : You will have to do the modifications in the \enfold\config-templatebuilder\avia-shortcodes\contentslider\contentslider.php around line 828.

    $output .= ! empty( $value['content'] ) ? "
    <div class='slide-entry-excerpt entry-content' $markup>" . ShortcodeHelper::avia_apply_autop( ShortcodeHelper::avia_remove_autop( $value['content'] ) ) . '</div>
    ' : '';
    

    The line above outputs the slide excerpt or content.

    Best regards,
    Ismael

    #1350135

    Hi where should i put the code if i want to display image title, copyright and size below each photo in masonry Gallery?

    #1350163

    Hi,

    The modification described here is for the content slider and the default gallery elements. For the masonry gallery, you will have to modify the enfold/config-templatebuilder/avia-shortcode-helpers/class-avia-masonry.php file. Look for this code around line 680.

    	/**
    					 * Allows to run shortcodes
    					 *
    					 * @since 4.8.3
    					 * @param string $content
    					 * @param array $entry
    					 * @param array $this->atts
    					 * @return string
    					 */
    					$content = apply_filters( 'avf_masonry_entry_content', $content, $entry, $this->config );
    

    Below add this code.

    
    $copyright_text = get_post_meta( $thumb_ID, '_avia_attachment_copyright', true );
    $content .= "
    <div class='av-masonry-image-info'>";
    $content .= "<span class='av-masonry-image-width'>Width: " . $attachment[1] . "</span>";
    $content .= "<span class='av-masonry-image-height'>Height: " . $attachment[2] . "</span>";
    $content .= $copyright_text;
    $content .= "</div>
    ";
    

    This should render the copyright, image size and content inside the masonry content container.

    Best regards,
    Ismael

    #1350440

    it works perfect. Thank you.

    Best support Team ever…

    #1350691

    Hi,
    Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘How to use the image copyright info within a Enfold Gallery’ is closed to new replies.