Hi fellow WordPressers.
I have a couple of issues with a plugin and theme, which I am assuming is CSS. However I am not a programmer (I mean at all), hence why I chose WordPress.
OK! The first is a miss alignment of a form. I think its because the theme width is too narrow (but I could be wrong).
The second appears on the Product page
The whole sidebar and footer gets wonky.
Does anyone understand the problems who can help me fix it. I am looking for the easiest way as I do not code.
Really appreciate any help as I love the theme and I love the shop plugin so hoping this can be sorted…
PS the Theme is called Swagger by Outerspice…
The same thing has happened on every skin that we test, EVERY skin. The opening page or “shop” page is completely, and totally messed up.
We tested it on 6 different skins, all were messed up.
Take a look: http://www.patriotexplodingtargets.com/shop/
If you cannot fathom the hooks, use the woocommerce_content() method to integrate with your custom themes.
Its only like it is because we cannot anticipate every themes structure.
Mike, I would prefer to use the hook method as it seems more stable?
Where do I put the code at? I assume I put all 4 lines of this code into a file on my site:
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); add_action('woocommerce_before_main_content', create_function('', 'echo "<section id=\"main\">";'), 10); add_action('woocommerce_after_main_content', create_function('', 'echo "</section>";'), 10);
functions.php of your theme – you will need to tweak the <section id=\”main\”> part.
The woocommerce_content method is easier as it uses your theme sidebars too, but you can try hooks first.
Mike I appreciate your assistance, I really do, but I just am not getting it. I was trying to figure this out so that I know what to do with my other clients when we start to integrate them to a new ecommerce solution.
Try not to be upset bro, you work with this stuff day in and day out, to some of us… well, its new. I would love to patron your company, but this one part is whats keeping me locked out, it happens man.
Trust me, the last thing I want to be doing is bothering you on the internet, and getting into the semantics of terminology about “template vs skins”, your far to busy for that.
Obviously if I could get this to work with one clients site, I could get it to work for all of them, so this would be a win win for me for sure.
I tried both methods, and well.. simply not getting it. One method simply made the page never stop loading with a message of No Products found etc. This is new ground for me as per hooks, as I have never had a need to use them up to this point, perhaps that was ignorant on my part, who knows.
So back to the drawing board for a solution unless some presents a much easier explanation that i can apply to all my clients.
Sad part is, every page looks awesome but the main opening page.
http://www.patriotexplodingtargets.com/shop/ <- Messed up
http://www.patriotexplodingtargets.com/cart/ <- Flawless
The woocommerce_content() method is what you should use.
Duplicate your theme’s page.php file, rename it to woocommerce.php and locate the loop. In twenty-10 the loop in page.php is:
<?php /* Run the loop to output the page. * If you want to overload this in a child theme then include a file * called loop-page.php and that will be used instead. */ get_template_part( 'loop', 'page' ); ?>
Some other themes likely have a ‘have_posts’ section (the part which outputs the page title/content etc).
Once you locate that you just need to replace it with:
<?php woocommerce_content(); ?>
That quite simply outputs the content area from woocommerce into your template with the correct layout.
Users who cannot do this can always use our pre-made themes. You should definitely look into the loop, and hooks and filters too, if your serious about developing for WordPress.
Thanks for that. Not sure if I understand it either, but will give it ago. Looking at the document on the link, this will solve the out of line sidebars.
This will not solve the form page being out of line too, or will it? I had it in my mind that this was a size issue rather than a hook.
I did the Woocommerce method and it did put my sidebar back there and brought my products into line. However I am still getting a syntax error as follows.
Warning: Invalid argument supplied for foreach() in jayceclarkephotoschool.com/wp-content/themes/swagger/functions/oswc-post-types.php on line 878.
I am still getting the checkout details out of line too.
Appreciate your help guys.
Ok, so here is what i did based upon what Mike said…
First I made the woocommerce.php page and put it into my themes directory, it was a duplicate of the page.php initially.
This is the loop that I think I found…
This is what I replaced it with…
I then saved the woocommerce.php file to my webserver in the themes folder, which produced these results:
If anyone can take a look at my page.php file which can be renamed of course to woocommerce.php and tell me where the hook goes, I would be very appreciative.
The link can be right clicked and saved as: http://www.christianrishel.info/temp/page.php
You cannot download the contents of a php page 😉
Looks like you just have not removed enough of your loop – there must be an un-needed endwhile in there.
And I removed it all finally, but the problem is this…
Take a look now: http://www.patriotexplodingtargets.com/shop/
It’s not embedded inside a black box area like every other page is, for example:
But the shop page does not, the content is supposed to be inside a black page.
Oh and Mike, I now know how to fix this on other client sites, which means I can use it on their sites. So yes, its good to fix this stuff for future clients for Woo right?
your sidebar is totally messed up. well i guess it is.
here is the fix.
go to your wordpress themes folder and open up ‘single.php’ or ‘page.php’ with your favorite editor. notepad works.
find out what the html code is around this line:
<?php get_sidebar(); ?>
yep you got it. there is a div around that line.
Similar to this maybe:
<div id="sidebar"> <?php get_sidebar(); ?> </div><!-- End of sidebar --> <div class="clear"></div>
or something else. It’s what you need.
ok so you now you know what is required.
there is a file in the woocommerce plugin folder called ‘sidebar.php’.
The path to the file that needs to be edited can be found here ‘/plugins/woocommerce/templates/shop/sidebar.php’.
all you need to do is to add the same code that you found in the single.php or page.php file around the line as above.
to make sure that the file you are about to change does not mess up when updating woocommerce you need to do the following.
make a folder in your themes folder called ‘woocommerce’.
in the ‘woocommerce’ folder make another folder called ‘shop’.
in the ‘shop’ folder copy the file called ‘sidebar.php’ into the ‘shop’ folder.
edit the copied file and save it.
so the file should be in the path:
‘/themes/<your theme folder>/woocommerce/shop/sidebar.php’
- The topic ‘Woocommerce bugs’ is closed to new replies.