Home › Forums › WoodMart support forum › Change badges position
Change badges position
- This topic has 12 replies, 2 voices, and was last updated 4 years, 11 months ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
January 5, 2020 at 10:10 pm #166402
nicksfikasParticipantHi,
For some reason when I activate my child theme the badges change position: https://www.dropbox.com/s/qefpa38dot2uv8j/Screenshot%202020-01-06%2000.05.53.png?dl=0This is how my website looks without the child theme:
https://www.dropbox.com/s/4gyvggqij2k5y4b/Screenshot%202020-01-06%2000.08.10.png?dl=0January 6, 2020 at 10:53 am #166477
Aizaz Imtiaz AwanKeymasterHello,
I visited your site. It’s due to your customization in child theme, when I activate the parent theme those badges shown on their right position.
So if you want to display those badges on the upper right corner of product image then simply undo you custom code changes which you make to change the position of badges and save the changes and then check back after clearing your site and browser cache.
Best Regards.
January 6, 2020 at 2:55 pm #166537
nicksfikasParticipantthis is the custom code from my child theme:
<?php
/**
* Enqueue script and styles for child theme
*/
function woodmart_child_enqueue_styles() {
wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array( ‘woodmart-style’ ), woodmart_get_theme_info( ‘Version’ ) );
}
add_action( ‘wp_enqueue_scripts’, ‘woodmart_child_enqueue_styles’, 1000 );// Ship to a different address closed by default
add_filter( ‘woocommerce_ship_to_different_address_checked’, ‘__return_false’ );//editable order statuses
add_filter( ‘wc_order_is_editable’, ‘wc_make_processing_orders_editable’, 10, 2 );
function wc_make_processing_orders_editable( $is_editable, $order ) {
if ( $order->get_status() == ‘processing’ )
{
$is_editable = true;
}
return $is_editable; }//remove shop title
add_filter( ‘woocommerce_show_page_title’, ‘bbloomer_hide_shop_page_title’ );function bbloomer_hide_shop_page_title( $title ) {
if ( is_shop() ) $title = false;
return $title;
}I don’t have any code for the badges :/
January 6, 2020 at 2:55 pm #166538
nicksfikasParticipantI also tried to remove this child theme and add a new blank one and the error is still there
January 7, 2020 at 6:17 am #166630
Aizaz Imtiaz AwanKeymasterHello,
When I inspect your child theme and then parent theme product page, there is a margin difference for badges. Normally our support did not cover the custom code issues which generates due to child theme because it is out of our scope. You are using the below code somewhere in your child theme due to which the position changes:
.onsale.product-label { left: 0; float: left; }
Just remove that code and then back after clearing your site and browser cache.
Best Regards.
January 7, 2020 at 8:38 am #166653
nicksfikasParticipantI created a new child theme and I have still the same issue…
I downloaded the child theme and the theme to a new local website and the issue doesn’t existWhat should I do?
January 7, 2020 at 10:23 am #166670
Aizaz Imtiaz AwanKeymasterHello,
Your problem is resolved. Actually your child theme style.css was empty and it picks that CSS code from the index.php file. So to fix this I copy the styling of parent theme and paste it into the child version of theme and it picks the correct style. Then I override with below CSS code:
.onsale.product-label { right: 0 !important; float: right !important; }
Now your badges shown perfectly fine even with the child theme.
Screenshot for clarification: https://jmp.sh/t33QMNwBest Regards.
January 7, 2020 at 10:33 am #166672
nicksfikasParticipantAfter you did this change I can not use WP Rocket
January 7, 2020 at 12:24 pm #166705
Aizaz Imtiaz AwanKeymasterHello,
The “Wp-Rocket” was disable in your site, I enable it and test it and it is working just fine.
Kindly clear your browser cache and then check back.
Best Regards.
January 8, 2020 at 10:57 am #166888
nicksfikasParticipantThe style.css that you wrote broke my website, so I had to delete it!
Nevermind I fixed the issue…I have another issue now, some product photos in the homepage look like this (see screenshot). How can I fix it?
Attachments:
You must be logged in to view attached files.January 8, 2020 at 11:41 am #166890
Aizaz Imtiaz AwanKeymasterHello,
I have seen your screenshots and test your site, Somewhere in your child theme you add custom code to customize the WoodMart buttons inside the product item card which causing this issue. Just undo those changes and your issue get fixed.
I have test your site with parent theme and there is no such issue. It looks just perfectly fine.
Screenshot for clarification: https://jmp.sh/oykcMLO
Best Regards.
January 8, 2020 at 11:56 am #166892
nicksfikasParticipantbut I haven’t added any custom code to customize the WoodMart buttons inside the product item card in my child theme. You can check
January 8, 2020 at 12:25 pm #166899
Aizaz Imtiaz AwanKeymasterHello,
You can check by activating your parent theme from Appearance >> Menus, The issue only sown in your child theme. I agreed as you said you do not write any custom code to customize the WoodMart buttons.
But this is also possible that you add some custom code for some other purposes in your child theme and it conflicts with the styling of those buttons which are inside the product grid item. So you have to troubleshoot your child theme because there must be some piece of code which change the styling of those buttons.
Best Regards.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register