Tagged: portfolio navigation
-
AuthorPosts
-
October 23, 2022 at 11:10 pm #1369907
Hello,
I would like to replace the thumbnail in the avia navigation to the left for the portfolio entry (link1) with another image (link2). Is it possible to do this? Or to replace the thumbnail of SYSPROG portfolio entry (link3) when it is displayed in navigation for the whole site.
Thank you,
MarinaOctober 24, 2022 at 12:33 am #1369924Hey Marina,
Thanks for the link to your site, typically we could replace images with others, but I’m not sure which ones you want to swap.
Please see the screenshot in the Private Content area.
if these are the correct images to swap then they are not the same aspect, one is square and the other is portrait and since they are in the masonry element this might not work correctly.
Why not change the featured image in the posts to correct? That is in the element like how the images are there now?
If I’m not looking at the correct images please explain further.Best regards,
MikeOctober 24, 2022 at 1:20 pm #1369968Hello Mike,
I would like to change just the image displayed in the navigation (link1) with another image, that is square (link2), so the result within navigation looks like (link3). But I do not want to change the featured image of the portfolio entry since I would like to have the not square image on the main portfolio page. Is it possible? I know the images I would like to swap are of different aspect ratio.
Thank you,
MarinaOctober 24, 2022 at 1:37 pm #1369971Hi,
Thanks for the screenshot of your post navigation, that was the part I didn’t understand.
That is a lot trickier, please go to the backend of that portfolio item and change the featured image, this will change the thumbnail in the post navigation.Best regards,
MikeOctober 24, 2022 at 1:48 pm #1369976Hello,
I changed the featured image. Was that the final solution or the intermediate step? :)
Best regards,
MarinaOctober 24, 2022 at 5:48 pm #1370021Hi,
This is the final solution, I checked your thumbnail in the post navigation and it is now the one you wanted, please clear your browser cache and check.
Please see the screenshot in the Private Content area.Best regards,
MikeOctober 24, 2022 at 5:53 pm #1370023Hello,
Yes, I know this solution, but then on Portfolio (see the link) page I have the same image as well, but I would like to have the old one there.
Best regards,
MarinaOctober 25, 2022 at 1:05 pm #1370155Hi,
Ok, try switching your featured image back and add this code to the end of your child theme functions.php file in Appearance ▸ Editor:function custom_replace_post_navigation_script() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($){ $("#top.postid-449 .avia-post-prev picture source").attr("srcset","your-image"); })(jQuery); }); </script> <?php } add_action('wp_footer', 'custom_replace_post_navigation_script');
in the script replace your-image with the image you want to use.
I tested with your logo, see the screenshot in the Private Content area.Best regards,
MikeOctober 25, 2022 at 2:36 pm #1370171Hello Mike,
Thank you very much, this is exactly what I needed. One more thing: the Russian version of the same page, postid-4613, see the link please. Please add this page to the code as well, the replacement image is the same, since the text is not readable on the thumbnail. I tried to add myself – no success. :)
Thank you,
MarinaOctober 25, 2022 at 5:57 pm #1370219Hi,
Try using this script instead:function custom_replace_post_navigation_script() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($){ $("#top.postid-449 .avia-post-prev picture source").attr("srcset","https://your-site/ms/wp-content/uploads/sysprog-thumbnail.jpg"); $("#top.postid-4613 .avia-post-prev img").attr("srcset","https://your-site/ms/wp-content/uploads/sysprog-thumbnail.jpg"); })(jQuery); }); </script> <?php } add_action('wp_footer', 'custom_replace_post_navigation_script');
Best regards,
MikeOctober 26, 2022 at 5:08 pm #1370336Hello Mike,
Now my issue is solved, thank you very much for help. I have one more question, if it is out of your scope, is completely fine and you can close the ticket, thanks again for the code.
The issue is with the Fixed Widget plugin: after update to the last version (requirement of PHP 7.2 now), the fixed widget disappears when scrolling up. Please see the links, the last sidebar widget is the fixed one. It can be some conflict with the theme CSS, could you give your opinion?
Best regards,
MarinaOctober 26, 2022 at 5:43 pm #1370377Hi,
It looks like the Fixed Widget plugin is not returning the css left value to zero after scrolling down.
Unfortunately, your page doesn’t get the “scrolled” class because of the sidebar menu so I don’t see an easy way to add some css to correct.
If you are using PHP v7.2, try updating to v7.4, this is what WordPress recommends as the minimum PHP version.
If this doesn’t correct disable the plugin and try using this solution instead.Best regards,
MikeOctober 26, 2022 at 8:27 pm #1370384Hello Mike,
I use PHP v7.4, so it shouldn’t be the problem. I am afraid that to adapt the solution you linked to my needs is out of my abilities. I need to be sticky just the
.widget_recent_entries in blog’s sidebar and the lower text widget on Privacy Policy in English and Russian, and that’s it. Is it possible to change the code you linked like that?Best regards,
MarinaOctober 27, 2022 at 12:56 am #1370393Hi,
I misunderstood, I thought you said you were using PHP v7.2
Can you disable the sticky plugin for a couple of days so I can test, or include an admin login so I can disable it while I test?Best regards,
MikeOctober 27, 2022 at 1:18 pm #1370451Hello Mike,
I disabled the Fixed Widget plugin, and you can find the admin credentials in the Private Content area.
Thank you for your help,
MarinaOctober 27, 2022 at 7:20 pm #1370489Hi,
Thanks for the login, I customized the script to make your sidebar widgets sticky on blog posts, and the two privacy policy pages, this is what I added to your child theme functions.phpfunction custom_sticky_sidebar_widgets() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($){ var width = $(window).width(); var $stickyTop = $('#top.single-post #recent-posts-3,#top.privacy-policy #custom_html-3,#top.page-id-8479 #custom_html-3'); if (width >= 767) { $stickyTop.waypoint(function(direction) { if (direction === 'down') { $stickyTop.css({ 'position': 'fixed', 'top': '40px', 'width': $stickyTop.innerWidth() }); } if (direction === 'up') { $stickyTop.css({ 'position': 'static', 'top': '0px', 'width': '' }); } }, { offset: '40px' }); } })(jQuery); }); </script> <?php } add_action('wp_footer', 'custom_sticky_sidebar_widgets');
please clear your browser cache and check.
Best regards,
MikeOctober 28, 2022 at 1:56 pm #1370560Hello Mike,
Thank you very much for the code, it works perfectly. You can close the ticket.
Thank you again,
MarinaOctober 28, 2022 at 5:46 pm #1370587Hi,
Glad we were able to 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 -
AuthorPosts
- The topic ‘Replace the thumbnail in portfolio entries navigation’ is closed to new replies.