Community Forums › Forums › Archived Forums › Design Tips and Tricks › All pages woocommerce – Changing the Margins
- This topic has 4 replies, 3 voices, and was last updated 8 years, 1 month ago by Victor Font.
-
AuthorPosts
-
February 23, 2016 at 3:44 pm #179748mmcclana24Member
Seems like this is probably a very simple edit. But not sure. I am using WooCommerce in conjunction with Streamline Pro and would like to change the margins of every page I have associated with woocommerce. All of the pages on my site that aren't associated with woocommerce, the margins are fine. But on the woocommerce pages there is zero space between my products, writing, etc and the edge of the page. What do I need to do in order to add margins to just the woocommerce pages?
I have a seperate question regarding the genesis woocommerce plugin. I tried to install this plugin and activate it with wordpress version 4.4.2, but it doesn't seem to change anything. When I activated woocommerce it normally asks you to allow built in pages, which it did not for me. I'm wondering if that is the reason the plugin is not working at all.
Anyway if I can get some direction on these two issues I would appreciate it.
Thank you
February 24, 2016 at 5:22 am #179781Victor FontModeratorWooCommerce has its own style sheet that loads after your theme's style sheet. Since you need to overrride the WooCommerce settings, you need to make sure you load the child theme's style sheet after WooCommerce so you can customize the settings in the child theme file. This article will help with that task: http://victorfont.com/change-genesis-child-theme-style-sheet-load-order/.
The Genesis WooCommerce connect plugin provides custom templates to display WooCommerce data. This has noting to do with the WooCommerce built-in pages. If the WooCommerce built-in pages weren't created for you, it's most likely another plugin blocking the process. You can create the pages yourself though. If you go the WooCommerce / System Status / Tools menu, there is a button to Install WooCommerce Pages.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 24, 2016 at 8:15 am #179794WhiteleyDesignsMemberAnother option for you, especially if you're simply trying to edit margins on all WooCommerce pages would be to find the class you want to modify and just use a more specific declaration in your child them than is used in WooCommerce so it overrides it without needing to reorder the queing of the stylesheets.
So, for example, if you want to override a style that looks like this where the body has a class of woocommerce:
.woocommerce { margin: 0; }
You could simply use this in your child theme:
body.woocommerce { margin: 10px; }
Since that is a more specific CSS declaration it will take priority over the default one.
Matt Whiteley – WhiteleyDesigns, GitHub
Designing, Developing & Creating with WordPressFebruary 29, 2016 at 11:41 am #180280mmcclana24MemberVictor, thanks for your response. I added the //* Load main style sheet after WooCommerce */
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
add_action( 'wp_enqueue_scripts', 'genesis_enqueue_main_stylesheet', 30 ); //change load priorityto my functions,php file of my child theme.
If you take a look at my website live2grow.com, you can see that my blog has a margin for every post. I haven't published my woocommerce products yet, but heres a link to the page I am having trouble with the margins. http://live2grow.com/travel-gear/
I inspected the element, but am not very experienced with CSS and knowing exactly what to edit. Can you give me some direction of what I would need to edit?
March 1, 2016 at 1:14 am #180310Victor FontModeratorPlease deactivate autoptimize while troubleshooting. It's not possible to tell where the the css issues extend from when files are minified and concatenated. Minifying css and javascript can also cause a variety of issues that don't exist in the un-minified file.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet? -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.