-
AuthorPosts
-
December 10, 2018 at 9:30 am #1042961
Hi team Kriesi
I’ve been trying to figure out how to display the product categories in a client Woocommerce shop above the category thumbnails on the shop homepage. (Link)
As you can see, the titles are now displayed below the images, but my client would like the category names to be displayed above those images. Do you have a piece of code or something to fix this?
Thanks so much!
December 10, 2018 at 8:46 pm #1043321Hey KatrienW,
Here is the code you can put in your funtions.php
function moveCatTitleWC(){ ?> <script> jQuery(window).load(function(){ jQuery('.archive.post-type-archive.post-type-archive-product .woocommerce-loop-category__title').prependTo(jQuery('.archive.post-type-archive.post-type-archive-product .product-category.product a')); }); </script> <?php } add_action('wp_footer', 'moveCatTitleWC');
If you need further assistance please let us know.
Best regards,
VictoriaDecember 11, 2018 at 10:03 am #1043665Hi Victoria
Thanks for your quick response. Unfortunately this code did not work for me, it resulted in an HTTP 500 error. Is it possible that there’s something missing from the code?
Thanks again!
December 12, 2018 at 2:58 pm #1044355Hi KatrienW,
Hmmmm…
Can you please check server log for error?
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?Best regards,
VictoriaDecember 14, 2018 at 1:31 pm #1045238Hi Victoria
The code works now, but now both categories are displayed above both images. I just want each category to be shown above each image, not all categories. Check the link to the shop to see what I mean.
December 19, 2018 at 11:54 am #1047138Hi, could someone please help me? The categories are still displayed double above the images …
December 22, 2018 at 6:26 pm #1048579Hi KatrienW,
Can you remove that code and try this one:
function moveCatTitleWC(){ ?> <script> jQuery(window).load(function(){ jQuery('.archive.post-type-archive.post-type-archive-product .woocommerce-loop-category__title').each(function() { var el = jQuery(this); el.prependTo(el.parents('.archive.post-type-archive.post-type-archive-product .product-category.product a')); }); }); </script> <?php } add_action('wp_footer', 'moveCatTitleWC');
If it does not work, please remove the code and let us know.
Best regards,
VictoriaDecember 23, 2018 at 12:05 pm #1048782Hi Victoria
Nope, another 500 error. Just to check if I’m doing it right: I put the code in the functions.php file at the bottom, NOT in the enfold-functions.php file. Is that correct? If you need login or ftp credentials, let me know.
December 29, 2018 at 2:29 pm #1049172Hi KatrienW,
Yes, please share your WordPress credentials and FTP.
Can you please check server log for error?
Best regards,
VictoriaJanuary 3, 2019 at 6:33 pm #1049672Can’t get the FTP right now because my client is on vacation, but here are credentials:
- This reply was modified 5 years, 11 months ago by KatrienW.
January 5, 2019 at 9:16 pm #1050390Hi,
The problem is that with WordPress only access, if we do something wrong and something brakes, we cant restore it back for you :(
Best regards,
BasilisJanuary 5, 2019 at 9:23 pm #1050397I found the FTP credentials ;)
January 9, 2019 at 3:55 pm #1051870Hi KatrienW,
I am getting a blank page on the login link. The website seems to be working, the code is working too but I cannot login to your Dashboard.
Best regards,
VictoriaJanuary 9, 2019 at 7:15 pm #1052037That’s weird, when I click the same link it takes me to the Dashboard. Maybe try /wp-login? I temporarily disabled WordFence, that might be a cause. The code isn’t working for me though, the titles still are displayed below the images.
January 12, 2019 at 2:23 pm #1053082January 16, 2019 at 11:02 am #1054517Hi, can you try again?
January 18, 2019 at 5:26 pm #1055524Hi KatrienW,
Best regards,
VictoriaJanuary 28, 2019 at 11:12 am #1059576It works now, thank you!
January 31, 2019 at 5:52 am #1060769 -
AuthorPosts
- You must be logged in to reply to this topic.