BLG3RNT
Forum Replies Created
-
Forum: Plugins
In reply to: WoocommerceHere is what you you need to do to fix the shop page. People are giving the answer, but not the full solution so let me try my best.
1) go to your page.php and figure out the coding for your regular page heading.
Example (from my site):<!-- CONTENT --> <div class="content left"> <div class="wrapper"> <div class="bg-title-page left"> <div class="bg-title-page-center left"> <div class="title-page-content left"> <h1><?php the_title()?></h1>
So from this you see I have 5 div containers before my title so that’s what I need to add with the coding everyone is pasting on this thread.
Copy as paste the divs that you need for your heading. NOTE: Not the <h1> tags.
I’d be copying this:
<div class="content left"> <div class="wrapper"> <div class="bg-title-page left"> <div class="bg-title-page-center left"> <div class="title-page-content left">
2) Go to your functions.php in your wordpress editor and enter the code at the very bottom before the final ?>
First to remove the woocommerce coding you’ll add these functions as show in earlier posts:
// WOOCOMMERCE remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
Then paste in the tags you copied from your page.php heading. Mine would look like this after this step:
// WOOCOMMERCE remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); <div class="content left"> <div class="wrapper"> <div class="bg-title-page left"> <div class="bg-title-page-center left"> <div class="title-page-content left">
Now break the quotes:
// WOOCOMMERCE remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10); <div class=\"content left\"> <div class=\"wrapper\"> <div class=\"bg-title-page left\"> <div class=\"bg-title-page-center left\"> <div class=\"title-page-content left\">
Next add this code in front of each div tag:
add_action('woocommerce_before_main_content', create_function('', 'echo "
And add this after each div tag:
";'), 10);
So your final line of coding would look like this:
add_action('woocommerce_before_main_content', create_function('', 'echo "<div class=\"content left\">";'), 10);
Then you will need to add this code for as many times as you added a new tag:
add_action('woocommerce_after_main_content', create_function('', 'echo "</div>";'), 10);
And that should fix it. Note if your theme isn’t using div tags, replace whatever tags your theme is using. I just used what was in my theme for an example.