Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1478021

    Hi,

    1.
    I’d like to show the thumbnails on archive pages of portfolio categories in their original dimensions (like the option you can choose in the settings of a portfolio-grid)

    2. eliminate the prefix „Archiv für:“

    Thank you very much for your help.

    Best regards
    Vera

    #1478317

    Hey Vera,
    I added this to your child theme functions.php:

    function override_post_thumbnail_size($size, $post_id) {
        if (is_archive()) {
            return 'full';
        }
        return $size;
    }
    add_filter('post_thumbnail_size', 'override_post_thumbnail_size', 10, 2);

    It is working, but you will need to adjust one of your images as it’s full size is smaller than the others (Blinder Port)

    Best regards,
    Mike

    #1478456

    Hi Mike,

    great! Thank you.

    Do you also have a solution for eliminating the prefix „Archiv für“? So that only the name of the category keeps visible.

    Best regards,
    Vera

    #1478500

    Hi,
    Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

      function custom_script() { ?>
      <script>
      (function($){
        $('#top.archive .main-title.entry-title a').each(function() {
          var text = $(this).text();
          $(this).text(text.replace('Archiv für: ', '')); 
      });
      })(jQuery);
      </script>
      <?php
    }
    add_action( 'wp_footer', 'custom_script', 99 );

    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.

    Best regards,
    Mike

    #1478586

    Hi Mike,

    thanks al lot. That works well.

    Best regards,
    Vera

    #1478607

    Hi,

    Great, I’m glad that Mike could help you out. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Dimension of thumbnails in grid of category archive’ is closed to new replies.