-
AuthorPosts
-
March 6, 2020 at 11:27 am #1190816
Hi
1. I want to enlarge the image of the category that will fill the entire width of the products below
2. After I select filtering in the right menu the image of the category disappears, can it remain?- This topic was modified 4 years, 8 months ago by Yossi Yerushalmi.
March 7, 2020 at 4:03 pm #1191123Hey Yossi,
Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:#top.archive #main .template-shop.content .page-thumb img { width: 100% !important; }
On some of your categories the “page-thumb” is not present, do all of your categories have a thumbnail image in the product categories option? If so perhaps there is a plugin conflict, have you tried disabling your plugins and checked?
Best regards,
MikeMarch 8, 2020 at 8:22 am #1191226Thanks so much, Mike
It works great!Is there a way to fix section 2 of my question?
YossiMarch 8, 2020 at 1:34 pm #1191253Hi,
Glad this is working for you, for question 2 please include admin login in the Private Content area so we can investigate further.Best regards,
MikeMarch 8, 2020 at 2:52 pm #1191269Hi Mike
ThanksMarch 8, 2020 at 4:40 pm #1191278Hi,
Thank you for the login, I’m not sure why this occurs, when the filters are used the image container is removed so the image doesn’t show. I wrote this workaround that will add the image container only on an archive page with the category term “term-43” only if the image container is missing, I believe this covers all of the “if’s”
Try adding this code to the end of your functions.php file in Appearance > Editor:function add_archive_thumb_for_term_earrings(){ ?> <script> (function($){ $(document).ready(function(){ $('#top.archive.term-43').each(function() { if($('.entry-content-wrapper .page-thumb').length) { } else { $('<div class="page-thumb"><img width="845" height="276" src="https://www.alinyerushalmi.co.il/wp-content/uploads/2019/09/earrings-alin-845x276.jpg" class="category_thumb" alt=""></div>').insertAfter('.woocommerce-notices-wrapper'); } }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_archive_thumb_for_term_earrings');
Then clear your browser cache and check.
Best regards,
MikeMarch 14, 2020 at 11:13 pm #1193140Hi Mike Thanks so much!
I’m sorry I haven’t checked it out beforeThe code you wrote really solved the problem but only on that specific page
https://www.alinyerushalmi.co.il/product-category/%d7%a2%d7%92%d7%99%d7%9c%d7%99%d7%9d/Is there a way to set this to all category pages?
Another question
If I want to add a CHILD THEME to the site now, it’s possible to add it after I’ve built it all?March 15, 2020 at 11:48 am #1193195Hi,
Glad to hear this helped, so since the function above is adding the “earring” image I wanted it to only work with category term “term-43”
When I look at your product categories I see you have three categories with images, so each one will need its own function.
will there be more than three?
This function works with all three categories:function add_archive_thumb_for_terms(){ ?> <script> (function($){ $(document).ready(function(){ $('#top.archive.term-43').each(function() { if($('.entry-content-wrapper .page-thumb').length) { } else { $('<div class="page-thumb"><img width="845" height="276" src="https://www.alinyerushalmi.co.il/wp-content/uploads/2019/09/earrings-alin-845x276.jpg" class="category_thumb" alt=""></div>').insertAfter('.woocommerce-notices-wrapper'); } }); $('#top.archive.term-44').each(function() { if($('.entry-content-wrapper .page-thumb').length) { } else { $('<div class="page-thumb"><img width="845" height="276" src="https://www.alinyerushalmi.co.il/wp-content/uploads/2019/09/Bracelet-alin-845x276.jpg" class="category_thumb" alt=""></div>').insertAfter('.woocommerce-notices-wrapper'); } }); $('#top.archive.term-42').each(function() { if($('.entry-content-wrapper .page-thumb').length) { } else { $('<div class="page-thumb"><img width="845" height="276" src="https://www.alinyerushalmi.co.il/wp-content/uploads/2019/09/Necklace-alin-845x276.jpg" class="category_thumb" alt=""></div>').insertAfter('.woocommerce-notices-wrapper'); } }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_archive_thumb_for_terms');
notice how I only changed the “#top.archive.term-XX” and the image url for each one, if you follow this you can create as many as you like.
Best regards,
MikeMarch 15, 2020 at 12:00 pm #1193199Mike thanks a lot !!
It is very, very helpful and clear, thank you!March 15, 2020 at 12:04 pm #1193201Hi,
Glad to hear, Unless there is anything else we can assist with on this issue, shall we close this then?Best regards,
MikeMarch 15, 2020 at 12:16 pm #1193203Yes I have
If I want to install a CHILD THEME to the site now, it’s possible to add it after I’ve built it all?
and I will make the changes in the functions.phpMarch 15, 2020 at 3:40 pm #1193231Hi,
Yes, you can install a child theme now, Read about it & Get it here After you activate your child theme you can then move your customizations from your parent theme functions.php, to your child theme functions.php. If you changed any theme files then typically you can add those to your child theme folder, it depends on the file.
To switch from your parent theme to the child theme and retain your same settings please follow these steps, first with your parent theme active go to Enfold Theme Options > Import/Export > Export Theme Settings File and download your theme settings file for fallback.
then activate your child theme and ensure your Enfold Theme Options > Performance > JS & CSS file merging and compression is turned off along with any caching plugins, then go to Enfold Theme Options > Import/Export > Import Settings From Your Parent Theme and import, then go to your homepage and clear your browser cache a couple of times and check that the settings have taken effect.
If it doesn’t look quite right then check that your Enfold Theme Options > Performance > JS & CSS file merging and compression is turned off and clear your browser cache a couple of more times.
If still not quite right, then go to Enfold Theme Options > Import/Export > Import Theme Settings File and upload the theme settings file you saved earlier, and clear your browser cache a couple of more times.
This should all work fine the first time, I only added the extra steps “just in case”.Best regards,
MikeApril 21, 2021 at 9:42 pm #1295884Hello
I design another store and have the same interest with the main image of the category
I want it to continue to appear even after filtering is selected
Only this time I am using a wide banner and have not been able to match the code to this changehttps://dev.strauss-co.com/product-category/strips/
And I have another problem with the image in the mobile display do not see the image it goes up and I can not arrange it to center-center
I can’t move the logo either
Attached is a mockup for what I am trying to achieve in mobile below 768px
https://dev.strauss-co.com/wp-content/uploads/Mockup-for-mobile.jpgBest regards,
Yossi- This reply was modified 3 years, 7 months ago by Yossi Yerushalmi.
April 24, 2021 at 9:35 pm #1296552Hi,
Thank you for the link to your /product-category/strips/ page but since this is a different site and it’s been over a year since we have looked at this customization I’m not quite sure if you are using the same script as above, can you include an admin login to this new site so I can take a look?
Thank you for the mockup image for the mobile header that you are trying to achieve, please try this css:@media only screen and (max-width: 767px) { .responsive #top #wrap_all .logo { float: none !important; margin: auto !important; } .responsive #top #wrap_all #header { height: 140px !important; } .responsive.html_bottom_nav_header.html_cart_at_menu #top #wrap_all .main_menu { top: 60px !important; right: 150px !important; } .responsive.html_bottom_nav_header #top #menu-item-shop.cart_dropdown { right: 90px !important; top: 60px !important; } }
Then clear your browser cache and check.
Best regards,
MikeApril 24, 2021 at 9:55 pm #1296555Hi Mike, Thank you!
attached in Private ContentI added the code you sent me, in the computer I changed Google to mobile looks excellent
but on my phone, I can not see the main menuBest regards,
YossiApril 25, 2021 at 6:21 pm #1296622Hi,
Thank you for the login details, but I’m getting a 403 error for the login page, perhaps this is a security setting, if so please whitelist my IP in the Private Content area.Best regards,
MikeApril 25, 2021 at 7:38 pm #1296626Try with my account, maybe it’s working
I’ll send a message to a storage manager about you IPApril 25, 2021 at 9:28 pm #1296631April 26, 2021 at 8:17 am #1296687Hi Mike
We have accessed your IP address
You can check it outBest regards,
YossiApril 28, 2021 at 3:06 pm #1297170Hi,
Thank you for the login, but I’m not sure why this is occurring, I have tried to recreate this on my server but so far I have not been able to. I see that you are using Variation Swatches for WooCommerce and Advanced Custom Fields together and this makes it complicated to try to recreate. When the filters are used the product description container that holds the image is removed so the page structure is changing. I might be able to inject the image with jQuery as we did a year ago, but we would need to write this for each category, do you plan on using a lot of categories? Does this also need to work for mobile? This might be a bigger job than it looks.Best regards,
MikeApril 28, 2021 at 3:42 pm #1297173Hi Mike, Thank you!
There will be no more categories, I have already created them all
Yes it should also be on mobile it can be smaller in heightBest regards,
Yossi- This reply was modified 3 years, 6 months ago by Yossi Yerushalmi.
May 2, 2021 at 12:29 am #1297750Hi,
Thank you for your patience, I added the function for the first category that has the slug “strips” and it seems to be working well, please check, but I notice that for your product categories this is the only one in English and I wonder if this was in error or if it will be changing, or if the other ones will be changing?
the slug is not in the code so the language doesn’t matter, but changing the slug may change the slug ID which is in the code, so please check if this will be changing and correct before I make the other categories so we don’t have to re-write the code later, thank you.Best regards,
MikeMay 2, 2021 at 3:54 pm #1297793Hi Mike
Thank you very much!!I corrected the category names to English.
I duplicated the code for each category
It works great!
Thank you!But it seems to me that the site does not move smoothly sometimes there is a delay of a second or two
I have a lot of products (900 products) in this store, I’m afraid it will be heavy
Is there a way it will be faster?Best regards,
YossiMay 2, 2021 at 6:41 pm #1297801Hi,
Glad to hear this helped. As for your site not moving smoothly, I took a look and your store seems to operate like any other woocommerce site I’ve checked, I note that you have several pro-level third-party woo plugins that will add overhead to your site but I’m really not seeing anything crazy right now. I also see that you are not caching right now either so as you add more products I would imagine the caching would offset this overhead too. Perhaps as you plan out your store, try to guide the customer along so the number of products shown on each screen are minimal, such as 20 instead of 200 that would also help, overall.Best regards,
MikeMay 2, 2021 at 10:43 pm #1297817Thank you very much!
I will share my client with this information
One thing remains at the moment
The logo with the menu does not align with the center on my mobile, it looks like thisMay 6, 2021 at 12:22 pm #1298776Hi,
Thank you for the screenshot, it seems that the issue occuurs for smaller mobile screens, 320px – 375px, to correct this please try this css:@media only screen and (max-width: 376px) { #menu-item-shop .cart_dropdown_link { padding: 0 !important; } .responsive.html_cart_at_menu #top .main_menu .menu>li:last-child { padding-right: 0 !important; margin-right: 0 !important; } .responsive #top #header_main > .container .main_menu .av-main-nav > li > a { padding: 0 0 0 8px !important; } .responsive.html_bottom_nav_header.html_cart_at_menu #top #wrap_all #header_main .main_menu { right: 120px !important; } }
After applying the css, please clear your browser cache and check.
Best regards,
MikeMay 6, 2021 at 10:24 pm #1298858Hi Mike, Congratulations!
Thank you very much!!
It works greatMay 7, 2021 at 12:24 pm #1298930Hi,
Glad we were able to help, we will close this now as it is quite long and covers several issues from multiple sites and thus becoming hard to follow. Typically we ask to start a separate thread for each request so it is easier for everyone to follow along. Thank you for using Enfold.
For any other questions or issues, feel free to start a new thread in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘top image in woocommerce category’ is closed to new replies.