%name WooCommerce   El sidebar no se muestra en su sitio

Your online store with WordPress

Not all templates are compatible with WordPress WooCommer. That means they have not been designed with WooCommerce contain own pages to display products, your shopping cart, etc. In my case, I happened that in a template that was used, showing a single product, the sidebar appeared moved and looked at the end of the web, as the space had to be placed to the right of the main content. Analyzing the design of my template and WooCommerce, I realized that WooCommerce plugin is a PHP file that defines where to embed products on the main content of your template. That file, which defines the main div the content of the web, had a different class of my template CSS. Correcting that, I managed to fix the problem.

This is the content of the file wp-contentpluginswoocommercetemplatesglobalwrapper-start.php:

<?php
/**
 * Content wrappers
 *
 * @author      WooThemes
 * @package     WooCommerce/Templates
 * @version     1.6.4
 */
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
$template = get_option( 'template' );
switch( $template ) {
    case 'twentyeleven' :
        echo '<div id="primary"><div id="content" role="main">';
        break;
    case 'twentytwelve' :
        echo '<div id="primary" class="site-content"><div id="content" role="main">';
        break;
    case 'twentythirteen' :
        echo '<div id="primary" class="site-content"><div id="content" role="main" class="entry-content twentythirteen">';
        break;
    case 'twentyfourteen' :
        echo '<div id="primary" class="content-area"><div id="content" role="main" class="site-content twentyfourteen"><div class="tfwc">';
        break;
    default :
        // La fila comentada es el valor por defecto
        //echo '<div id="container"><div id="content" role="main">';
        // La siguiente fila está personalizada a mi template
        echo '<div id="primary" class="site-content"><div id="content" role="main">';
        break;
}

I modified the row, in default, I've had to match my template, which in my case came defined in the file page.php.

As you can see, the file wrapper-start.php is designed for templates that comes by default WordPress, but if it does not fit our template, we have design problems and to solve it, it is best to add a new condition (case) Again with the name of our template and indicate the code that corresponds to us.

Dime qué te ha parecido el artículo...

rating off WooCommerce   El sidebar no se muestra en su sitiorating off WooCommerce   El sidebar no se muestra en su sitiorating off WooCommerce   El sidebar no se muestra en su sitiorating off WooCommerce   El sidebar no se muestra en su sitiorating off WooCommerce   El sidebar no se muestra en su sitio (Ninguna valoración todavía)
loading WooCommerce   El sidebar no se muestra en su sitioCargando…
Advertisements

Use of cookies

This site uses cookies for you to have the best user experience. If you continue to browse you are giving your consent to the acceptance of the above cookies and acceptance of our cookies policy, Click the link for more information.

OK
Notice of cookies

Veo que te gusta mi Blog...

Si te ha parecido interesante este artículo, no esperes a suscribirte a mi blog. Cuando vuelva a escribir otro seguro que te interesará y no desearás no haberte enterado. Puedes suscribirte con total tranquilidad de que no recibirás spam. Lo odio igual que tu. Solo quiero que aprendas cosas nuevas y te sientas agusto con mis artículos. ¡Gracias!

Thank you for subscribing!

Pin it on Pinterest

Share This

Share

Share this with your friends!