Tagged: Copyright Field
-
AuthorPosts
-
June 18, 2020 at 3:02 pm #1223725
Hi,
there’s a way to add the content of the Media Copyright Field on front-end without adv layout editor?
tksJune 18, 2020 at 6:34 pm #1223858Hey Rafael,
Could you please attach a mockup of what you’re trying to achieve?
Which element are you talking about here?
Best regards,
VictoriaJune 22, 2020 at 2:19 pm #1224601hi there, yes i can!
in the backend there is 2 fields:
Description and Copyright,
https://www.dropbox.com/s/lp2a9cskmum63j9/fields.jpg?dl=0i wish to add both below my images like this:
https://www.dropbox.com/s/idwqbylx0m9gp0j/mockup.jpg?dl=0Could you help me?
tks- This reply was modified 4 years, 5 months ago by emanar.
June 24, 2020 at 7:50 pm #1225321Hi, there,
Anyone can help me?
Please advise.June 25, 2020 at 2:29 pm #1225510Hi 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,
VictoriaJune 27, 2020 at 6:29 pm #1226103Hi 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, 4 months ago by emanar.
June 29, 2020 at 3:49 pm #1226486Hi emanar,
You need to modify the files, depending on which page you need to add the copyright.
Best regards,
VictoriaJuly 2, 2020 at 9:25 pm #1227579I need to add this to every image add with the native wordpress image.
how can i do that?July 8, 2020 at 3:40 pm #1228898Hi,
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 -
AuthorPosts
- You must be logged in to reply to this topic.