-
AuthorPosts
-
April 18, 2017 at 1:11 pm #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
MauroApril 18, 2017 at 4:06 pm #779424Hey 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,
VictoriaApril 19, 2017 at 11:46 am #779909Ok 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)April 19, 2017 at 12:31 pm #779924I believe the same happened to me, but the solution does not work.
April 20, 2017 at 12:58 pm #780508Hi 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,
VictoriaApril 20, 2017 at 12:59 pm #780509Hi 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,
VictoriaApril 20, 2017 at 2:32 pm #780540Ok 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.jpgThank you Mauro
April 20, 2017 at 5:28 pm #780675Thank you Victoria, that worked!
April 24, 2017 at 7:10 pm #782480Hi 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??
April 24, 2017 at 8:06 pm #782505Hey!
That can be done with some custom JS, it would be better to consider hire someone to help you with that task.
Cheers!
BasilisApril 24, 2017 at 10:06 pm #782550Hi @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.
April 25, 2017 at 11:48 am #782779Hi,
Great, glad you got it working and thank a lot for sharing, much appreciated :-)
Best regards,
RikardApril 26, 2017 at 1:00 pm #783438Thank 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
April 27, 2017 at 5:47 am #783786November 15, 2018 at 5:10 pm #1034039Hello,
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 definedHow should be fixed?
Thank you
MauroNovember 19, 2018 at 12:33 am #1034947Hi,
Where is that function located, according to the plugin?
Best regards,
BasilisJanuary 28, 2019 at 4:23 pm #1059653Hello
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 500PHP 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
MauroJanuary 29, 2019 at 9:02 pm #1060171Hi 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!
January 30, 2019 at 1:01 pm #1060460Thank you rmf339,
in this case I prefer to adjust it through css without touching theme filesJanuary 30, 2019 at 3:09 pm #1060502Well here is a little thing i wrote to replace tags with others:
this comes to functions.php of your child-themefunction 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 willJanuary 31, 2019 at 7:40 pm #1061121Thank you Guenni007
it works perfectly
January 31, 2019 at 8:59 pm #1061172Hey profumopuntoit,
Did you need additional help, or shall this topic be closed?
Best regards,
Jordan ShannonFebruary 1, 2019 at 4:21 pm #1061597Hi
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
MauroFebruary 2, 2019 at 12:15 am #1061803Hi,
If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Product slider font size changed from h3 to h2’ is closed to new replies.