Viewing 24 posts - 1 through 24 (of 24 total)
  • Author
    Posts
  • #779256

    Dear Kriesi support,
    after recent updates product slider font size changed from h3 to h2 and now result in a exaggeratedly big font
    Please see https://goo.gl/CU1ZWW (updated site) and https://goo.gl/KXKEXb (backup and not updated site)
    Any suggestion on how to restore to h3 dimension?
    Thank you
    Mauro

    #779424

    Hey Mauro,

    Here is the code you can put in Enfold > General Styling > Quick Css,  if it does not work, put into themes/enfold/css/custom.css

    
    .woocommerce-loop-category__title {
        font-size: 20px;
    }
    

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #779909

    Ok thank you
    But now in some pages the same class is rendered as
    Open Sans 20px (600) (please see product category names in https://goo.gl/UqPO3O)
    and in some other as
    Open Sans 15px (regular) (please see product slider in https://goo.gl/CU1ZWW)

    #779924

    I believe the same happened to me, but the solution does not work.

    #780508

    Hi Mauro,

    That is a different class, so you can edit the code:

    
    .woocommerce-loop-category__title, .woocommerce-loop-product__title {
        font-size: 20px;
    }
    

    Let us know if this was helpful.
    Best regards,
    Victoria

    #780509

    Hi MitchEelants,

    The solution did not work for you because the page is different and you elements have a different class.
    This code will work for you:

    
    .woocommerce-loop-category__title, .woocommerce-loop-product__title {
        font-size: 20px;
    }
    

    Ad then you can set font size to whatever you like.
    If you need further assistance please let us know.
    Best regards,
    Victoria

    #780540

    Ok thank you
    I set
    .woocommerce-loop-category__title, .woocommerce-loop-product__title {
    font-size: 17px;
    font-weight: 600;
    }

    it works for the product category names (https://goo.gl/UqPO3O)
    but not for the product slider in the home where the font is rendered as 15px normal
    please see http://www.profumo.it/screenshots/Cattura.jpg

    Thank you Mauro

    #780675

    Thank you Victoria, that worked!

    #782480

    Hi all!!

    I have the same issue here and I’d go further: I don’t want the tag to be H2 but I want H3 instead.

    Is there a way to change it without losing the change on upcoming updates??

    #782505

    Hey!

    That can be done with some custom JS, it would be better to consider hire someone to help you with that task.

    Cheers!
    Basilis

    #782550

    Hi @basilis,

    Thanks for your help, but it seems you’re wrong. I did the modifications using hooks in function.php using this:

    /*
     * Modify product slider from h2 to h4
     */
    remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10, 2 );
    
    function action_woocommerce_shop_loop_item_title( $woocommerce_template_loop_product_title, $int ) {
    	echo '<h4 class="woocommerce-loop-product__title">' . get_the_title() . '</h4>';
    };
    
    add_action( 'woocommerce_shop_loop_item_title', 'action_woocommerce_shop_loop_item_title', 10, 2 );

    I guess problem is solved guys! Just append this to your functions.php using APPEARANCE > Editor

    You may change the H4 I used to any other tag you might want.

    #782779

    Hi,

    Great, glad you got it working and thank a lot for sharing, much appreciated :-)

    Best regards,
    Rikard

    #783438

    Thank you very much rmf339.

    That’s what I wanted to keep the coherence with design of the theme

    It should be integrated in Enfold

    it works

    #783786

    Hi @profumopuntoit,

    Thanks for the feedback.

    Best regards,
    Rikard

    #1034039

    Hello,
    I reopen this ticket because I have installed Query Monitor plugin just to give a check, and in the section Php errors is highlighting that the code kindly suggested by rmf339 in https://kriesi.at/support/topic/product-slider-font-size-changed-from-h3-to-h2/#post-782550
    in the line
    function action_woocommerce_shop_loop_item_title( $woocommerce_template_loop_product_title, $int ) {
    is giving error in
    Missing argument 2 for action_woocommerce_shop_loop_item_title(), called in /wp-includes/class-wp-hook.php on line 286 and defined

    How should be fixed?

    Thank you
    Mauro

    #1034947

    Hi,

    Where is that function located, according to the plugin?

    Best regards,
    Basilis

    #1059653

    Hello
    the function is in functions.php in the child theme
    We are changing server and the new one is running on php 7,3 while the previous was on 7.0
    This function is now throwing error 500

    PHP message: PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function action_woocommerce_shop_loop_item_title(),

    and we had to comment it and now product names in the slider in the home are back to H2 and they are too big
    How should be fixed?
    Thank you
    Mauro

    #1060171

    Hi profumopuntoit, how are you?

    Do you use Enfold? Try to move the function from file functions.php to file functions-enfold.php.

    If you don’t use enfold but a similar Kriesi theme, try to do the same.

    After updating Enfold we had to move all hooking functions to this file instead of using on functions.php because they stopped working properly.

    Hope it works!

    #1060460

    Thank you rmf339,
    in this case I prefer to adjust it through css without touching theme files

    #1060502

    Well here is a little thing i wrote to replace tags with others:
    this comes to functions.php of your child-theme

    function replace_tags_with_tags(){
    ?>
    <script>
      (function($) {       
          function replaceElementTag(targetSelector, newTagString) {
            $(targetSelector).each(function(){
              var newElem = $(newTagString, {html: $(this).html()});
              $.each(this.attributes, function() {
                newElem.attr(this.name, this.value);
              });
              $(this).replaceWith(newElem);
            });
          }
          replaceElementTag('tag-to-replace', '<newTag></newTag>'); 
      }(jQuery)); 
    </script>
    <?php
    }
    add_action('wp_footer', 'replace_tags_with_tags');

    the thing you had to adjust is now only that line: replaceElementTag('tag-to-replace', '<newTag></newTag>');
    first is the tag to replace ( be specific ) the second is the new surrounding tag.
    All attributes from the first goes to the new tag !

    function replace_tags_with_tags(){
    ?>
    <script>
      (function($) {       
          function replaceElementTag(targetSelector, newTagString) {
            $(targetSelector).each(function(){
              var newElem = $(newTagString, {html: $(this).html()});
              $.each(this.attributes, function() {
                newElem.attr(this.name, this.value);
              });
              $(this).replaceWith(newElem);
            });
          }
          replaceElementTag('h2.woocommerce-loop-product__title', '<h3></h3>');
          replaceElementTag('h2.woocommerce-loop-category__title', '<h3></h3>'); 
    
      }(jQuery)); 
    </script>
    <?php
    }
    add_action('wp_footer', 'replace_tags_with_tags');

    you can add more lines to replace more tags separated by semicolon

    Just adjust it to your needs – you have to know the tag before ( the more selective you are the better).
    But i do not know if it will work with a slider – but i think it will

    #1061121

    Thank you Guenni007

    it works perfectly

    #1061172

    Hey profumopuntoit,

    Did you need additional help, or shall this topic be closed?

    Best regards,
    Jordan Shannon

    #1061597

    Hi
    you can close
    I can only suggest here, as the suggestion page is close since long, that product names in the slider would be better if they are coded as H3 or H4 certainly not H2 that are big and meant for subtitles
    Thank you
    Mauro

    #1061803

    Hi,

    If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 24 posts - 1 through 24 (of 24 total)
  • The topic ‘Product slider font size changed from h3 to h2’ is closed to new replies.