Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #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,
    Marina

    #1369924

    Hey 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,
    Mike

    #1369968

    Hello 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,
    Marina

    #1369971

    Hi,
    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,
    Mike

    #1369976

    Hello,

    I changed the featured image. Was that the final solution or the intermediate step? :)

    Best regards,
    Marina

    #1370021

    Hi,
    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,
    Mike

    #1370023

    Hello,

    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,
    Marina

    #1370155

    Hi,
    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,
    Mike

    #1370171

    Hello 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,
    Marina

    #1370219

    Hi,
    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,
    Mike

    #1370336

    Hello 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,
    Marina

    #1370377

    Hi,
    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,
    Mike

    #1370384

    Hello 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,
    Marina

    #1370393

    Hi,
    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,
    Mike

    #1370451

    Hello Mike,

    I disabled the Fixed Widget plugin, and you can find the admin credentials in the Private Content area.

    Thank you for your help,
    Marina

    #1370489

    Hi,
    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.php

    function 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,
    Mike

    #1370560

    Hello Mike,

    Thank you very much for the code, it works perfectly. You can close the ticket.

    Thank you again,
    Marina

    #1370587

    Hi,
    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

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘Replace the thumbnail in portfolio entries navigation’ is closed to new replies.