Forum Replies Created
-
AuthorPosts
-
March 27, 2021 at 8:57 pm in reply to: Show Copyright for images in Standard Editor Blog Posts #1290779
For sure, Guenni, nor problem: https://bavotasan.com/2012/add-a-copyright-field-to-the-media-uploader-in-wordpress/. What do you think? Any suggestions?
March 25, 2021 at 7:06 pm in reply to: Show Copyright for images in Standard Editor Blog Posts #1290445Hi Nikko,
Thanks for your reply. I found some links online that seemed to offer a solution for this problem. Isn’t the link in private about basically the same thing I want to achieve?
Best regards,
DanielMarch 24, 2021 at 10:24 am in reply to: Show Copyright for images in Standard Editor Blog Posts #1290056Hi Nikko,
I will try to find a good solution. But since the copyright is implemented through Enfold I would have to know which selector I have to use to call the copyright field content from an image with added copyright information.
In your code I found:
_avia_attachment_copyright
Is this where the copyright information is saved?
Could I use something like that:
function get_image_copyright( $attachment_id = null ) { $attachment_id = attachment_url_to_postid( $image_url ); if ( $attachment_id ) return get_post_meta( $attachment_id, '_avia_attachment_copyright', true ); }
Does that trigger the wanted information? If yes I only need a hint where to place a function to show it for every image in the blog.
Something like:
echo get_image_copyright();
What do you think?
All the best,
DanielMarch 23, 2021 at 7:45 pm in reply to: Show Copyright for images in Standard Editor Blog Posts #1289982Hey Nikko,
thanks for the code. I made some adjustments and it kind of works, but it’s not really convenient. I invested several hours to automatically place the copyright line with the image in the text, depending on the alignment of the image in the text flow.
add_filter('get_image_tag', function($html, $id, $alt, $title, $align, $size) { $copyright_text = get_post_meta( $id, '_avia_attachment_copyright', true ); if ($copyright_text) { $image = $html; $html = '<figure class="copyright-image-wrapper">' . $image; $html .= '<p class="my-copyright">' . $copyright_text . '</p>'; $html .= '</figure>'; } return $html; }, 10, 6); function copyright_textfluss(){ ?> <script> jQuery(document).ready(function($) { $('.copyright-image-wrapper:has(.alignleft)').addClass('alignleft'); $('.copyright-image-wrapper:has(.aligncenter)').addClass('aligncenter'); $('.copyright-image-wrapper:has(.alignright)').addClass('alignright'); }); </script> <?php } add_action('wp_head', 'copyright_textfluss');
But there are still two problems:
• All the html-markup stays in the blog entry if a picture is deleted. This is annoying and therefore not a really nice solution …
• The copyright-information is simply copied into the text, there is no connection to the database. If there are changes to the copyright-information in the media library it won’t reflect in the blog.In the theme image-element it adds a snippet to the shortcode like [copyright=’icon-reveal’]. Couldn’t something like that also be implemented for the standard editor?
Hope you have a good idea!
March 22, 2021 at 9:57 am in reply to: Show Copyright for images in Standard Editor Blog Posts #1289578Dear Nikko,
Thank you for your answer. Since the data is saved in the database, it should also be able use it in the standard editor. There are even instructions on the Internet for this, but they refer to a selfmade copyright field (see link) but the field is already given by your theme.
In the meantime I found a post from Ismael, unfortunately I don’t quite understand the explanation since it offers possibilities and not one single solution. It seems to be about exactly the issue that I am facing: https://kriesi.at/support/topic/copyright-images-2/#post-1228898
Therefore I believe there is an option for this and would be happy to receive a brief explanation or instructions. Thank you!
March 18, 2021 at 9:36 am in reply to: Show Copyright for images in Standard Editor Blog Posts #1288902Hey Nikko,
basically i have the problem on several sites, all of which I run with your great theme.In the Advanced Editor I can set when and how the copyright should be displayed. In the blog I use the standard editor and insert the images via “insert media”. At this point I have no choice regarding the display of the copyright information.
Enclosed you will find a link to an exemplary page. For the header image I found a short css code in the forums and the copyright shows beneath the picture. The picture is used again at the end of the article. Inserted via the standard editor. There we had to manually add the copyright in the caption, as there is no way to show it automatically …
As I said, my aim is to show the copyright information for all images that are used in the blog via the standard editor, provided that the copyright information has been saved in the media library with the image.
I found some snippets for functions.php on the web and the forums but none is working in the expected way.
Hoping for a solution!
Cheers, Daniel
Added some CSS. Works for me.
You can close this thread.
Thanks again!Perfect! Tested and tweaked it a little bit and it just works. Thank you.
Any chance to hide the badge while the banner is opened?
Hey Rikard,
normally the banner is always shown on first pageload. If you then make a selection whether cookies are allowed or not, the banner disappears. After that you can see the badge on the side and use it to display the banner again. I would like to only see the badge right from the start and display the banner using the badge as a toggle. The banner should not appear when the page is loaded until the visitor decides what to do, it should only be displayed via the badge. There is a css class added after the cookie decision. Perhaps, for example, you could add this beforehand so that you don’t just see the banner, as I said, but only show it via the badge.
Can you understand it better like that? Thanks for your help!
All the best,
DanielHey Ismael,
thank you for your fast answer. I removed the line and it does the trick!
Happy customer with more than 30 installations of your theme and now my first support question with correct answer in no time at all – thank you!Hey dear Enfold-Support-Team-Members, I used the code Isamel provided (2017-09-30) in serveral installations. Worked like charm! Right now there seems to be a problem. In latest WP and latest Enfold the
function avia_disable_alb_drag_drop_mod
is not working anymore. If the complete code is added the advanced builder is active for all user roles, not only for'editor', 'administrator', 'author'
. Could you take a look into the part of the function that is checking the roles? I would need a helping hand to sort it out. At some of my pages it is now possible to access the advanced layout builder for roles that should not be able to drag and drop. Thank you! (answers in English or German please – thanks) -
AuthorPosts