Question

I've been trying to add custom div's to my woocommerce product page, without result. All I've been finding is vague documentation pointing me towards "hooks". So I've done everything instructed in these documents. (Copy and create the woocommerce folder within my theme, creating hooks in my functions.php)

Here's one such hook I wrote, but it's doing nothing.

function add_borders(){
echo "<div class='corner-left-top'>       </div>";
echo "<div class='corner-left-bottom'>    </div>";
echo "<div class='corner-right-top'>      </div>";
echo "<div class='corner-right-bottom'>   </div>";

echo "<div class='border-left'>           </div>";
echo "<div class='border-right'>          </div>";
echo "<div class='border-top'>            </div>";
echo "<div class='border-bottom'>         </div>";
}
add_action('woo_content_after','add_borders');

I think I'm doing something completely wrong, because it shouldn't be this hard simply adding divs to a page. Could someone point me in the right direction?

Était-ce utile?

La solution

Woocommerce seriously overuses this hooks feature, making the code much much harder to follow.

I suggest a decent IDE with full project search features.

Back to your specific problem, provided this is a one off site (not a theme to be sold) then just dive straight into the template files themselves.

Copy the woocomerce folder to your theme (already done i believe) then edit yourthemefolder/woocommerce/content-single-product.php

Autres conseils

Are you sure the hook exists? I tried looking for it in the documentation, but couldn't find it.

http://docs.woothemes.com/document/hooks/

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top