Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #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!

    #1043321

    Hey 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,
    Victoria

    #1043665

    Hi 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!

    #1044355

    Hi 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,
    Victoria

    #1045238

    Hi 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.

    #1047138

    Hi, could someone please help me? The categories are still displayed double above the images …

    #1048579

    Hi 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,
    Victoria

    #1048782

    Hi 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.

    #1049172

    Hi KatrienW,

    Yes, please share your WordPress credentials and FTP.

    Can you please check server log for error?

    Best regards,
    Victoria

    #1049672

    Can’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.
    #1050390

    Hi,

    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,
    Basilis

    #1050397

    I found the FTP credentials ;)

    #1051870

    Hi 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,
    Victoria

    #1052037

    That’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.

    #1053082

    Hi KatrienW,

    Image 2019-01-12 at 14.23.44.png

    Credentials did not work for me. Could you please update the credentials?

    Best regards,
    Victoria

    #1054517

    Hi, can you try again?

    #1055524

    Hi KatrienW,

    Best regards,
    Victoria

    #1059576

    It works now, thank you!

    #1060769

    Hi,

    Great, glad you got it working. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 19 posts - 1 through 19 (of 19 total)
  • You must be logged in to reply to this topic.