Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1223725

    Hi,
    there’s a way to add the content of the Media Copyright Field on front-end without adv layout editor?
    tks

    #1223858

    Hey Rafael,

    Could you please attach a mockup of what you’re trying to achieve?

    Which element are you talking about here?

    Best regards,
    Victoria

    #1224601

    hi there, yes i can!
    in the backend there is 2 fields:
    Description and Copyright,
    https://www.dropbox.com/s/lp2a9cskmum63j9/fields.jpg?dl=0

    i wish to add both below my images like this:
    https://www.dropbox.com/s/idwqbylx0m9gp0j/mockup.jpg?dl=0

    Could you help me?
    tks

    • This reply was modified 4 years, 3 months ago by emanar.
    #1225321

    Hi, there,
    Anyone can help me?
    Please advise.

    #1225510

    Hi emanar,

    Please have a look at the following thread:
    https://kriesi.at/support/topic/copyright-option-for-images/

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1226103

    Hi Victoria, tks for the reply, but that doesn’t work because we don’t use avias page builder. There is a way to add this without the advanced Page builder?

    Tks

    • This reply was modified 4 years, 3 months ago by emanar.
    #1226486

    Hi emanar,

    You need to modify the files, depending on which page you need to add the copyright.

    Best regards,
    Victoria

    #1227579

    I need to add this to every image add with the native wordpress image.
    how can i do that?

    #1228898

    Hi,

    Thank you for the inquiry,

    You can get the value of the copyright option by using the get_post_meta function.

    get_post_meta( $post->ID, '_avia_attachment_copyright', true )
    

    And to filter or adjust the default WordPress image markup, use the get_image_tag filter.

    add_filter('get_image_tag', function($html, $id, $alt, $title, $align, $size) {
         $copyright = get_post_meta( $post->ID, '_avia_attachment_copyright', true );
         // do something to $html before returning it
         if($copyright) {
             $html .= "<span>{$copyright}</span>";
         }
         return $html;
    }, 10, 6);
    

    Another solution is to add a new attribute to the attachment image using the wp_get_attachment_image_attributes filter, but it might require additional script to extract the value of the new attribute and render it in the frontend.

    Best regards,
    Ismael

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