-
AuthorPosts
-
January 10, 2021 at 3:10 pm #1271363
Hi,
I have some issues with the masonry gallery element.
I updated my child function.php with this code, to open links in a new tab:
function add_custom_target(){ ?> <script> jQuery(window).load(function(){ jQuery('.av-masonry-container a ').attr('target','_blank'); }); </script> <?php } add_action('wp_footer', 'add_custom_target');
This works great when all the posts are displayed but if for ex. 4 out of 8 posts are displayed (and you need to click “LOAD MORE”, there are 2 problems:
1. The posts that load after clicking “LOAD MORE” don’t open on a new tab.
2. The sort row displays only the “Portfolio Entries” of the displayed posts, while I want all the “Portfolio Entries” to be displayed, so even when a certain post is not displayed, and will load when clicking the “LOAD MORE” button, it’s “Portfolio Entry”/”Category” will still be displayed on the sort line. In short, have all “Portfolio Entries” show all the time, regardless of whether their posts are displayed on the first load (before clicking “LOAD MORE”).
How can I fix this?
Thanks in advance
January 11, 2021 at 4:37 pm #1271639This reply has been marked as private.January 11, 2021 at 6:37 pm #1271673Hey Sasha,
Thanks for contacting us!
1- Please go to Appearance > Editor and edit /enfold/config-templatebuilder/avia-shortcodes/av-helper-masonry.php file and replace it with following – https://raw.githubusercontent.com/KriesiMedia/enfold-library/master/temp_fixes/Enfold_4_7_6_4/config-templatebuilder/av-helper-masonry.php
Then edit your Masonry Gallery element and give your images custom links and under Advanced > Link Settings > Image Link choose to ” Use custom link” option and open them in new window.2-
I understand what you mean however I think this is limitation of loading with ajax. To make sure, I will check with our devs :)
Edit: Please see Ismael’s reply here – https://kriesi.at/support/topic/masonary-grid-only-shows-some-product-categories/#post-1104642 :)Regards,
Yigit- This reply was modified 3 years, 11 months ago by Yigit.
January 14, 2021 at 4:29 am #1272297Hi Yigit,
I did as you suggested but it didn’t work (It made the whole page black…).
Is there any way to modify the code I used (which I took from enfold documentation for masonry gallery) so that when clicking on posts, that are loaded after “LOAD MORE” is clicked, they will also open on a new tab?
Thanks
January 14, 2021 at 4:11 pm #1272435This reply has been marked as private.January 16, 2021 at 4:39 am #1272850Hi sasha,
Thanks for the update. The version of the theme you are running is very old, and we can’t provide support for versions which are that old. Could you try copying the site to a staging site and update there first maybe?
The update to 4.7.x has to be done manually from the version you are running, please refer to my replies in this thread: https://kriesi.at/support/topic/enfold-4-5-theme-update-update-failed-download-failed-a-valid-url-was-not-pro/#post-1021541
You can either update manually via FTP: https://kriesi.at/documentation/enfold/how-to-install-enfold-theme/#theme-update, or use a plugin to upload the theme zip file: https://wordpress.org/plugins/update-theme-and-plugins-from-zip-file/
If that doesn’t work then please try to delete the whole theme folder, then replace it with the new version. Make sure that you have backups of the site before starting updating.
Also please read this after you have updated: https://kriesi.at/documentation/enfold/theme-registration/
When the update is done then we can have a look at the styling issues you are getting, and the changes you are requesting in this thread as well.
Best regards,
RikardJanuary 17, 2021 at 4:52 am #1272996Hi,
I understand but we won’t be able to update the theme in the next couple of months and still need help on this.
This is the code that is suggested on Enfold documentation to open gallery image links in a new window:
function add_custom_target(){ ?> <script> jQuery(window).load(function(){ jQuery('.av-masonry-container a ').attr('target','_blank'); }); </script> <?php } add_action('wp_footer', 'add_custom_target');
As I mentioned, it works great when all the images are displayed but if for ex. 4 out of 8 images are displayed, and you need to click “LOAD MORE”, The links of the images that load after clicking “LOAD MORE” don’t open on a new window/tab.
Can you please suggest a fix to this code that will make all the image links open in a new tab/window and not only the ones the load before clicking “LOAD MORE”?
Thanks
January 18, 2021 at 5:17 pm #1273385Hi sasha,
Well, it works in the new version without the code and so you might want to update the theme to the latest. Why can’t you update it? You’re running an old version and probably an old WordPress version too, you really need to update those.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.