<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Theming - CODIBU</title>
	<atom:link href="https://help.codibu.com/kbtopic/theming/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.codibu.com</link>
	<description>Hosting &#38; Domain,  Development &#38; Design, SEO &#38; Marketing, 2300+ Themes &#38; Plugins, Free SEO analysis &#38; tools</description>
	<lastBuildDate>Sun, 08 Nov 2020 16:17:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://help.codibu.com/wp-content/uploads/2022/07/favicon.png</url>
	<title>Theming - CODIBU</title>
	<link>https://help.codibu.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>WooCommerce Theme Developer Handbook</title>
		<link>https://help.codibu.com/blog/woocommerce-theme-developer-handbook/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=woocommerce-theme-developer-handbook</link>
					<comments>https://help.codibu.com/blog/woocommerce-theme-developer-handbook/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Sun, 08 Nov 2020 16:17:31 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/woocommerce-theme-developer-handbook/</guid>

					<description><![CDATA[<p>WooCommerce looks great with all WordPress themes as of version 3.3, even if they are not WooCommerce-specific themes and do not formally declare support. Templates render inside<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/woocommerce-theme-developer-handbook/">WooCommerce Theme Developer Handbook</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>WooCommerce looks great with <a href="https://help.codibu.com/blog/kb/wc-3-3-will-look-great-on-all-the-themes/" rel="noopener noreferrer">all WordPress themes as of version 3.3</a>, even if they are not WooCommerce-specific themes and do not formally declare support. Templates render inside the content, and this keeps everything looking natural on your site.</p>
<p>Non-WooCommerce themes, by default, also include:</p>
<ul>
<li>Zoom feature enabled – ability to zoom in/out on a product image</li>
<li>Lightbox feature enabled – product gallery images pop up to examine closer</li>
<li>Comments enabled, not Reviews – visitors/buyers can leave comments, same as a post, and not product ratings or reviews</li>
</ul>
<p>If you want more control over the layout of WooCommerce elements or full reviews support your theme will need to integrate with WooCommerce. There are a few different ways you can do this, and they are outlined below.</p>
<div class="woo-sc-box note   "><strong>Note:</strong> Note that this is a <strong>Developer level</strong> doc. Select a <a href="https://woocommerce.com/customizations/" target="_blank" rel="noopener noreferrer">WooExpert or Developer</a> for help if you’re unfamiliar with code/templates and resolving potential conflicts; or use a <a href="http://woocommerce.com/product-category/themes/" rel="noopener noreferrer">WooCommerce theme</a>. We’re unable to assist with customization under our Support Policy, as the issue is with your theme and not WooCommerce.</div>
<h2 id="section-1">Theme Integration</h2>
<p>There are three possible ways to integrate WooCommerce with a theme. If you are using WooCommerce 3.2 or below you will need to use one of these methods to ensure WooCommerce shop and product pages are rendered correctly in your theme. If you are using a version of WooCommerce 3.3 or above you only need to do a theme integration if the automatic one doesn’t meet your needs.</p>
<h3 id="section-2">Using woocommerce_content()</h3>
<p>This solution allows you to create a new template page within your theme that is used for <strong>all WooCommerce taxonomy and post type displays.</strong> While an easy catch-all solution, it does have a drawback in that this template is used for <strong>all WC</strong> taxonomies (product categories, etc.) and post types (product archives, single product pages). Developers are encouraged to use the hooks instead.</p>
<p>To set up this template page:</p>
<p><strong>1. Duplicate page.php</strong></p>
<p>Duplicate your theme’s <strong>page.php</strong> file, and name it <strong>woocommerce.php.</strong> This file should be found like this: <code>wp-content/themes/YOURTHEME/woocommerce.php</code>.</p>
<p><strong>2. Edit your page (woocommerce.php)</strong></p>
<p>Open up your newly created <strong>woocommerce.php</strong> in a text editor, or the editor of your choice.</p>
<p><strong>3. Replace the loop</strong></p>
<p>Next you need to find the loop (see The_Loop). The loop usually starts with a:</p>
<pre>&lt;?php if ( have_posts() ) :
</pre>
<p>and usually ends with:</p>
<pre>&lt;?php endif; ?&gt;
</pre>
<p>This varies between themes. Once you have found it, <strong>delete it</strong>. In its place, put:</p>
<pre>&lt;?php woocommerce_content(); ?&gt;
</pre>
<p>This will make it use <strong>WooCommerce’s loop instead.</strong> Save the file. You’re done.</p>
<div class="woo-sc-box info   "><strong>Note:</strong> When creating <strong>woocommerce.php</strong> in your theme’s folder, you will not be able to override the woocommerce/<strong>archive-product.php</strong> custom template as woocommerce.php has priority over archive-product.php. This is intended to prevent display issues.</div>
<h3 id="section-3">Using hooks</h3>
<p>The hook method is more involved, but it is also <strong>more flexible</strong>. This is similar to the method we use when creating themes. It’s also the method we use to integrate nicely with Twenty Ten to Twenty Sixteen themes.</p>
<p>Insert a few lines in your <strong>theme’s functions.php</strong> file.</p>
<p>First <strong>unhook</strong> the WooCommerce wrappers:</p>
<pre>remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
</pre>
<p>Then hook in your own functions to display the wrappers your theme requires:</p>
<pre>add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);

function my_theme_wrapper_start() {
    echo '&lt;section id="main"&gt;';
}

function my_theme_wrapper_end() {
    echo '&lt;/section&gt;';
}
</pre>
<p>Make sure that the markup matches that of your theme. If you’re unsure of which classes or IDs to use, take a look at your theme’s page.php for guidance.</p>
<p><strong>Whenever possible use the hooks to add or remove content. This method is more robust than overriding the templates.</strong> If you have overridden a template, you have to update the template any time the file changes. If you are using the hooks, you will only have to update if the hooks change, which happens much less frequently.</p>
<h3 id="section-4">Using template overrides</h3>
<p>For information about overriding the WooCommerce templates with your own custom templates read the Template Structure section below. This method requires more maintenance than the hook-based method, as templates will need to be kept up-to-date with the WooCommerce core templates.</p>
<h2 id="section-5">Declaring WooCommerce Support</h2>
<p>If you are using custom WooCommerce template overrides in your theme you need to declare WooCommerce support using the <code>add_theme_support</code> function. WooCommerce template overrides are only enabled on themes that declare WooCommerce support. If you do not declare WooCommerce support in your theme, WooCommerce will assume the theme is not designed for WooCommerce compatibility and will use shortcode-based unsupported theme rendering to display the shop.</p>
<p>Declaring WooCommerce support is straightforward and involves adding one function in your theme’s functions.php file.</p>
<h3 id="section-6">Basic Usage</h3>
<pre>function mytheme_add_woocommerce_support() {
    add_theme_support( 'woocommerce' );
}

add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
</pre>
<p>Make sure you are using the <code>after_setup_theme</code> hook and not the <code>init</code> hook. Read more about this at the documentation for add_theme_support.</p>
<h3 id="section-7">Usage with Settings</h3>
<pre>function mytheme_add_woocommerce_support() {
    add_theme_support( 'woocommerce', array(
        'thumbnail_image_width' =&gt; 150,
        'single_image_width'    =&gt; 300,

        'product_grid'          =&gt; array(
            'default_rows'    =&gt; 3,
            'min_rows'        =&gt; 2,
            'max_rows'        =&gt; 8,
            'default_columns' =&gt; 4,
            'min_columns'     =&gt; 2,
            'max_columns'     =&gt; 5,
        ),
    ) );
}

add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
</pre>
<p>These are optional theme settings that you can set when declaring WooCommerce support.</p>
<p><code>thumbnail_image_width</code> and <code>single_image_width</code> will set the image sizes for the shop. If these are not declared when adding theme support, the user can set image sizes in the Customizer under the <strong>WooCommerce &gt; Product Images</strong> section.</p>
<p>The <code>product_grid</code> settings let theme developers set default, minimum, and maximum column and row settings for the Shop. Users can set the rows and columns in the Customizer under the <strong>WooCommerce &gt; Product Catalog</strong> section.</p>
<h3 id="section-8">Product gallery features (zoom, swipe, lightbox)</h3>
<p>The product gallery introduced in 3.0.0 (<a href="https://help.codibu.com/blog/kb/new-product-gallery-merged-in-to-core-for-2-7/" target="_blank" rel="noopener noreferrer">read here for more information</a>) uses Flexslider, Photoswipe, and the jQuery Zoom plugin to offer swiping, lightboxes and other neat features.</p>
<p>In versions <code>3.0</code>, <code>3.1</code>, and <code>3.2</code>, the new gallery is off by default and needs to be enabled using a snippet (below) or by using a compatible theme. This is because it’s common for themes to disable the WooCommerce gallery and replace it with their own scripts.</p>
<p>In versions <code>3.3</code>+, the gallery is off by default for WooCommerce compatible themes unless they declare support for it (below). 3rd party themes with no WooCommerce support will have the gallery enabled by default.</p>
<p>To enable the gallery in your theme, you can declare support like this:</p>
<pre>add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
</pre>
<p>You do not have to support all 3 parts of the gallery; you can pick and choose features. If a feature is not enabled, the scripts will not be loaded and the gallery code will not execute on product pages.</p>
<p>If gallery features are enabled (e.g. you have a theme which enabled them, or you are running a non-WC compatible theme), you can disable them with <code>remove_theme_support</code>:</p>
<pre>remove_theme_support( 'wc-product-gallery-zoom' );
remove_theme_support( 'wc-product-gallery-lightbox' );
remove_theme_support( 'wc-product-gallery-slider' );
</pre>
<p>You can disable any parts; you do not need to disable all features.</p>
<h2 id="section-9">Template Structure</h2>
<p>WooCommerce template files contain the <strong>markup</strong> and <strong>template structure</strong> for <strong>frontend and HTML emails</strong> of your store. If some structural change in HTML is necessary, you should override a template.</p>
<p>When you open these files, you will notice they all contain <strong>hooks</strong> that allow you to add/move content without needing to edit template files themselves. This method protects against upgrade issues, as the template files can be left completely untouched.</p>
<p>Template files can be found within the <code>**/woocommerce/templates/**</code> directory.</p>
<h3 id="section-10">How to Edit Files</h3>
<p>Edit files in an <strong>upgrade-safe way</strong> using <strong>overrides</strong>. Copy it into a directory within your theme named <code>/woocommerce</code> keeping the same file structure but removing the <code>/templates/</code>subdirectory.</p>
<p>Example: To override the admin order notification, copy: <code>wp-content/plugins/woocommerce/templates/emails/admin-new-order.php</code> to <code>wp-content/themes/yourtheme/woocommerce/emails/admin-new-order.php</code></p>
<p>The copied file will now override the WooCommerce default template file.</p>
<div class="woo-sc-box alert   "><strong>Warning:</strong> Do not delete any of WooCommerce hooks when overriding a template. This would prevent plugins hooking in to add content.</div>
<div class="woo-sc-box alert   "><strong>Warning: </strong>Do not edit these files within the core plugin itself as they are overwritten during the upgrade process and any customizations will be lost.</div>
<h2 id="section-11">CSS Structure</h2>
<p>Inside the <code>assets/css/</code> directory, you will find the stylesheets responsible for the default WooCommerce layout styles.</p>
<p>Files to look for are <code>woocommerce.scss</code> and <code>woocommerce.css</code>.</p>
<ul>
<li><code>woocommerce.css</code> is the minified stylesheet – it’s the CSS without any of the spaces, indents, etc. This makes the file very fast to load. This file is referenced by the plugin and declares all WooCommerce styles.</li>
<li><code>woocommerce.scss</code> is not directly used by the plugin, but by the team developing WooCommerce. We use SASS in this file to script the CSS in the first file easier and faster.</li>
</ul>
<p>The CSS is written to make the default layout compatible with as many themes as possible by using % widths for all layout styles. It is, however, likely that you’ll want to make your own adjustments.</p>
<h3 id="section-12">Modifications</h3>
<p>To avoid upgrade issues, we advise not editing these files but rather use them as a point of reference.</p>
<p>If you just want to make changes, we recommend adding some overriding styles to your theme stylesheet. For example, add the following to your theme stylesheet to make WooCommerce buttons black instead of the default color:</p>
<pre>a.button, 
button.button, 
input.button, 
#review_form #submit {
    background:black; 
}
</pre>
<p>WooCommerce also outputs the theme name (plus other useful information, such as which type of page is being viewed) as a class on the body tag, which can be useful for overriding styles.</p>
<h3 id="section-13">Disabling WooCommerce styles</h3>
<p>If you plan to make major changes, or create a theme from scratch, then you may prefer your theme not reference the WooCommerce stylesheet at all. You can tell WooCommerce to not use the default <code>woocommerce.css</code>.</p>
<p>Add the following code to your theme’s <code>functions.php</code> file:</p>
<pre>add_filter( 'woocommerce_enqueue_styles', '__return_false' );</pre>
<p>With this definition in place, your theme will no longer use the WooCommerce stylesheet and give you a blank canvas upon which you can build your own desired layout/style.</p>
<p>Styling a WooCommerce theme from scratch for the first time is no easy task. There are many different pages and elements that need to be styled, and if you’re new to WooCommerce, you are probably not familiar with many of them. A non-exhaustive list of WooCommerce elements to style can be found <a href="https://developer.files.wordpress.com/2017/12/woocommerce-theme-testing-checklist.pdf" target="_blank" rel="noopener noreferrer">here</a>.</p>
<h2 id="section-14">Examples</h2>
<p>Storefront is <strong>the official WooCommerce theme</strong> built to the same exact standards as WooCommerce itself. The code is available on GitHub.</p>
<p>If you would like to see examples of other themes that have added WooCommerce support and with their own styles, we suggest looking at the following themes, which can be downloaded from their showcase pages on WordPress.com:</p>
<ul>
<li>Karuna</li>
<li>Shoreditch</li>
<li>Independent Publisher 2</li>
<li>Pique</li>
<li>Libre 2</li>
<li>Button 2</li>
<li>Radcliffe 2</li>
<li>Lodestar</li>
</ul><p>The post <a href="https://help.codibu.com/blog/woocommerce-theme-developer-handbook/">WooCommerce Theme Developer Handbook</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/woocommerce-theme-developer-handbook/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Image Sizes for Theme Developers</title>
		<link>https://help.codibu.com/blog/image-sizes-for-theme-developers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=image-sizes-for-theme-developers</link>
					<comments>https://help.codibu.com/blog/image-sizes-for-theme-developers/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Sun, 08 Nov 2020 16:17:02 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/image-sizes-for-theme-developers/</guid>

					<description><![CDATA[<p>To display images in your catalog, WooCommerce registers a few image sizes which define the actual image dimensions to be used. These sizes include: woocommerce_thumbnail – used<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/image-sizes-for-theme-developers/">Image Sizes for Theme Developers</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>To display images in your catalog, WooCommerce registers a few image sizes which define the actual image dimensions to be used. These sizes include:</p>
<ul>
<li><code>woocommerce_thumbnail</code> – used in the product ‘grids’ in places such as the shop page.</li>
<li><code>woocommerce_single</code> – used on single product pages.</li>
<li><code>woocommerce_gallery_thumbnail</code> – used below the main image on the single product page to switch the gallery.</li>
</ul>
<p><code>woocommerce_single</code> shows the full product image, as uploaded, so is always uncropped by default. It defaults to 600px width.</p>
<p><code>woocommerce_gallery_thumbnail</code> is always square cropped and defaults to 100×100 pixels. This is used for navigating images in the gallery.</p>
<p><code>woocommerce_thumbnail</code> defaults to 600px width, square cropped so the product grids look neat. The aspect ratio for cropping can be customized by the store owner.</p>
<p>It is important to note that despite the actual image widths that are set, themes can ultimately change the size images are displayed using CSS, and image widths may be limited by the product grid/column widths.</p>
<h2 id="section-1">Themes can define image sizes</h2>
<p>Starting with WooCommerce 3.3.0, themes can declare what sizes should be used when declaring WooCommerce support. If a theme defines the image sizes (widths), the store owner will not be able to change them, but the size defined should be optimal for the theme.</p>
<pre><code class="language-php">add_theme_support( 'woocommerce', array(
'thumbnail_image_width' =&gt; 200,
'gallery_thumbnail_image_width' =&gt; 100,
'single_image_width' =&gt; 500,
) );
</code></pre>
<p>When calling WordPress functions which expect an image size e.g. <code>wp_get_attachment_image_src</code>, you should use the image size names — these are:</p>
<ul>
<li><code>woocommerce_thumbnail</code></li>
<li><code>woocommerce_single</code></li>
<li><code>woocommerce_gallery_thumbnail</code></li>
</ul>
<p>Store owners will still be able to control aspect ratio and cropping (see below).</p>
<h2 id="section-2">Customize image sizes in the customizer</h2>
<p>The customizer houses the options which control thumbnails in WooCommerce.</p>
<p><a href="https://help.codibu.com/wp-content/uploads/2020/11/imagefeature.png"><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-12586" src="https://help.codibu.com/wp-content/uploads/2020/11/imagefeature.png" alt="" width="712" height="456" /></a></p>
<p>If the theme is declaring image sizes, the top section will be hidden and only the cropping option will be visible.</p>
<p>Changing the cropping option, or widths, will update the preview on the right side to show how things will look. Changes will not be visible to customers until the customizer is ‘published’ and the thumbnails have been regenerated to the new dimensions.</p>
<p>The thumbnail cropping section in the customizer allows store owners to select one of three cropping ratio settings for images in the catalog:</p>
<ul>
<li>1:1 (Square scropping)</li>
<li>Custom (Store owner can enter a custom aspect ratio)</li>
<li>Uncropped (Preserve single image aspect ratio)</li>
</ul>
<p>Actual image dimensions are then calculated based on the cropping option selected, and the image width.</p>
<h2 id="section-3">Changing image sizes via hooks</h2>
<p>Whilst themes can fix image sizes at certain widths, and store owners can control widths and aspect ratios, if you need more control over thumbnail sizes there are some hooks available to you.</p>
<p>The <code>wc_get_image_size</code> function is used by WooCommerce to get the image size dimensions. The return value of this is passed through a filter:</p>
<p><code>woocommerce_get_image_size_{SIZE_NAME_WITHOUT_WOOCOMMERCE_PREFIX}</code></p>
<p>If using this hook you’ll be passed an array of sizes, similar to this:</p>
<pre><code class="language-php">array(
'width' =&gt; 200,
'height' =&gt; 200,
'crop' =&gt; 1,
)
</code></pre>
<p>So for example, if I wanted to change gallery thumbnails to be 150x150px uncropped images, you could use the following code:</p>
<pre><code class="language-php">add_filter( 'woocommerce_get_image_size_gallery_thumbnail', function( $size ) {
return array(
'width' =&gt; 150,
'height' =&gt; 150,
'crop' =&gt; 0,
);
} );
</code></pre>
<p>We don’t recommend plugins and themes go this route because it removes control from the store owner and their settings won’t be respected, but the option is there for store owners.</p>
<p><strong>Note:</strong> after making changes to image sizes you may need to regenerate your thumbnails so the new sizes are used for existing images.</p>
<h2 id="section-4">Changing what image sizes are used in WooCommerce via hooks</h2>
<p>As well as the above hook, some template functions in WooCommerce run the image size through a filter so you can use something other than the WooCommerce registered image sizes.</p>
<p>The following filters exist:</p>
<table>
<thead>
<tr>
<th>FILTER</th>
<th>DESCRIPTION</th>
<th>DEFAULT</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>single_product_archive_thumbnail_size</code></td>
<td>Controls the size used in the product grid/catalog.</td>
<td><code>woocommerce_thumbnail</code></td>
</tr>
<tr>
<td><code>subcategory_archive_thumbnail_size</code></td>
<td>Controls the size used in the product grid/catalog for category images.</td>
<td><code>woocommerce_thumbnail</code></td>
</tr>
<tr>
<td><code>woocommerce_gallery_thumbnail_size</code></td>
<td>Controls the size used in the product gallery, below to main image, to switch to a different image.</td>
<td>Array representing the dimensions of the <code>gallery_thumbnail</code> image size. Usually <code>array( 100, 100 )</code>.</td>
</tr>
<tr>
<td><code>woocommerce_gallery_image_size</code></td>
<td>Controls the size used in the product gallery.</td>
<td><code>woocommerce_single</code></td>
</tr>
<tr>
<td><code>woocommerce_gallery_full_size</code></td>
<td>Controls the size used in the product gallery to zoom or view the full size image.</td>
<td><code>full</code></td>
</tr>
</tbody>
</table>
<p><strong>Note:</strong> <code>full</code> is a size registered by WordPress and set in <code>Settings &amp;gt; Media.</code></p>
<p>As an example, let’s say I wanted to make the gallery thumbnail size used the <code>thumbnail</code> size registered by WordPress instead of <code>woocommerce_gallery_thumbnail</code>. The following snippet would do the job:</p>
<pre><code class="language-php">add_filter( 'woocommerce_gallery_thumbnail_size', function( $size ) {
return 'thumbnail';
} );
</code></pre>
<p><strong>Note:</strong> The hooks listed above are used by WooCommerce core. If a theme has custom template files or uses it’s own functions to output images, these filters may not be in use.</p><p>The post <a href="https://help.codibu.com/blog/image-sizes-for-theme-developers/">Image Sizes for Theme Developers</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/image-sizes-for-theme-developers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Fixing Outdated WooCommerce Templates</title>
		<link>https://help.codibu.com/blog/fixing-outdated-woocommerce-templates/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fixing-outdated-woocommerce-templates</link>
					<comments>https://help.codibu.com/blog/fixing-outdated-woocommerce-templates/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Sun, 08 Nov 2020 16:16:28 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/fixing-outdated-woocommerce-templates/</guid>

					<description><![CDATA[<p>Template Updates and changes We sometimes update the default templates when a new version of WooCommerce is released. This applies to major releases (WooCommerce 2.6, 3.0,<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/fixing-outdated-woocommerce-templates/">Fixing Outdated WooCommerce Templates</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2 id="section-1">Template Updates and changes</h2>
<p>We sometimes update the default templates when a new version of WooCommerce is released. This applies to major releases (WooCommerce 2.6, 3.0, and 4.0) but also to minor releases (WooCommerce 3.8.0).</p>
<p>Starting in WooCommerce version 3.3, <a href="https://help.codibu.com/blog/kb/wc-3-3-will-look-great-on-all-the-themes/">most themes will look great with WooCommerce</a>.</p>
<p>Our developer focused blog will list any template file changes with each release.</p>
<p>If, however, you are using a theme with older templates or an older version of WooCommerce, you may need to update templates yourself or contact the theme author for an update.</p>
<ul>
<li>Most theme authors fix themes in a timely manner, so you only need to update your theme to get the updated templates.</li>
<li>You need to update templates yourself if you modified templates or are using a child theme.</li>
</ul>
<p>Otherwise, you need to select and use a different theme that already uses current WooCommerce templates.</p>
<div class="woo-sc-box note   "><b>Note:</b> This is a <b>Developer level</b> doc provided as guidance. We are unable to dispense advice or review code under our<span class="Apple-converted-space"> </span><a href="https://help.codibu.com/blog/kb/support-policy/"><span class="s2">Support Policy</span></a>.</div>
<p>&nbsp;</p>
<h2 id="section-2"><b>How to update outdated templates</b></h2>
<p>We need to determine what templates to update, make a backup of old templates and then restore any customizations.</p>
<ol>
<li><strong>Go to</strong>: <b>WooCommerce &gt; Status &gt; System Status</b>. Scroll to the end of the page where there is a list of templates overridden by your theme/child theme and a warning message that they need to be updated. For example, the templates <code>form-pay.php</code> and <code>form-login.phph</code> are outdated:</li>
</ol>
<figure class="wp-block-image size-large">
<a href="https://help.codibu.com/wp-content/uploads/2020/11/wc_410_fix_outdate_theme_templates.png"><img decoding="async" class="aligncenter size-full wp-image-10793" src="https://help.codibu.com/wp-content/uploads/2020/11/wc_410_fix_outdate_theme_templates.png" alt="" width="950" height="138" /></a><br />
</figure>
<ol start="2">
<li><strong>Save a backup of the outdated template.</strong></li>
<li><strong>Copy</strong> the default template from <b>wp-content/plugins/woocommerce/templates/[path-to-the-template]</b> and paste it in your theme folder found at: <strong>wp-content/themes/[path-to-theme]</strong></li>
<li><strong>Open</strong> the template you pasted into the theme folder with a text editor of choice, such as Atom, Visual Code, BBEdit, Notepad++, and replicate any changes that you had to the previous template in your new, updated template file.</li>
</ol>
<p>We recognize that it can be time-consuming. This is why we try to avoid changing WooCommerce templates, but sometimes it is wise to break backward compatibility.</p>
<h2 id="section-3">FAQ</h2>
<h3 id="section-4">Where can I find the latest version of WooCommerce?</h3>
<p>If you’re looking for the default templates to use for updating, you want to use the latest version of WooCommerce. There are a few easy ways to get the templates:</p>
<ul>
<li>Access the files via FTP if your current WooCommerce installation is up to date.</li>
<li>Find the templates per WooCommerce version in our <a href="https://help.codibu.com/blog/kb/template-structure-overriding-templates-via-a-theme/">Template Structure</a> documentation.</li>
<li>Download the latest version from the <a href="https://wordpress.org/plugins/woocommerce/">WordPress.org plugin page.</a></li>
<li>Download all versions from the GitHub repository.</li>
</ul>
<h3 id="section-5">Why don’t you make a button to click and update everything?</h3>
<p>It’s impossible to make a video or a one-click update. Why? Because there are thousands of themes, and every theme is coded differently. One size does not fit all.</p><p>The post <a href="https://help.codibu.com/blog/fixing-outdated-woocommerce-templates/">Fixing Outdated WooCommerce Templates</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/fixing-outdated-woocommerce-templates/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Display Category Image on Category Archive</title>
		<link>https://help.codibu.com/blog/display-category-image-on-category-archive/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=display-category-image-on-category-archive</link>
					<comments>https://help.codibu.com/blog/display-category-image-on-category-archive/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Sun, 08 Nov 2020 16:16:01 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/display-category-image-on-category-archive/</guid>

					<description><![CDATA[<p>/** * Display category image on category archive */ add_action( &#8216;woocommerce_archive_description&#8217;, &#8216;woocommerce_category_image&#8217;, 2 ); function woocommerce_category_image() { if ( is_product_category() ){ global $wp_query; $cat = $wp_query-&#62;get_queried_object(); $thumbnail_id = get_term_meta( $cat-&#62;term_id, &#8216;thumbnail_id&#8217;, true ); $image =<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/display-category-image-on-category-archive/">Display Category Image on Category Archive</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>/** * Display category image on category archive */ add_action( &#8216;woocommerce_archive_description&#8217;, &#8216;woocommerce_category_image&#8217;, 2 ); function woocommerce_category_image() { if ( is_product_category() ){ global $wp_query; $cat = $wp_query-<span class="pl-kos">&gt;</span>get_queried_object(); $thumbnail_id = get_term_meta( $cat-<span class="pl-kos">&gt;</span>term_id, &#8216;thumbnail_id&#8217;, true ); $image = wp_get_attachment_url( $thumbnail_id ); if ( $image ) { echo &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">img</span> <span class="pl-c1">src</span>=&#8221;<span class="pl-s">&#8216; . $image . &#8216;</span>&#8221; <span class="pl-c1">alt</span>=&#8221;<span class="pl-s">&#8216; . $cat-&gt;name . &#8216;</span>&#8221; /&gt;&#8217;; } } }</p><p>The post <a href="https://help.codibu.com/blog/display-category-image-on-category-archive/">Display Category Image on Category Archive</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/display-category-image-on-category-archive/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Overriding the product search box (widget)</title>
		<link>https://help.codibu.com/blog/overriding-the-product-search-box-widget/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=overriding-the-product-search-box-widget</link>
					<comments>https://help.codibu.com/blog/overriding-the-product-search-box-widget/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Sun, 08 Nov 2020 16:15:24 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/overriding-the-product-search-box-widget/</guid>

					<description><![CDATA[<p>The product search box widget loads the search box using the template function: get_product_search_form() For more info, see: Function get_product_search_form. It then looks for the product search<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/overriding-the-product-search-box-widget/">Overriding the product search box (widget)</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The product search box widget loads the search box using the template function:</p>
<pre class="brush: php; gutter: false">get_product_search_form()</pre>
<p>For more info, see: Function get_product_search_form.</p>
<p>It then looks for the product search form in the file ‘product-searchform.php’ or uses its default markup. You can override the default WooCommerce template product-searchform.php by customizing the markup.</p>
<p>For reference, the default markup is:</p>
<div id="gist88076301" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-product-search-form-html" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-html  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-product-search-form-html-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-product-search-form-html-LC1" class="blob-code blob-code-inner js-file-line"><span class="pl-kos">&lt;</span><span class="pl-ent">form</span> <span class="pl-c1">role</span>=&#8221;<span class="pl-s">search</span>&#8221; <span class="pl-c1">method</span>=&#8221;<span class="pl-s">get</span>&#8221; <span class="pl-c1">class</span>=&#8221;<span class="pl-s">woocommerce-product-search</span>&#8221; <span class="pl-c1">action</span>=&#8221;<span class="pl-s">&lt;?php echo esc_url( home_url( &#8216;/&#8217; ) ); ?&gt;</span>&#8220;<span class="pl-kos">&gt;</span></td>
</tr>
<tr>
<td id="file-wc-product-search-form-html-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-product-search-form-html-LC2" class="blob-code blob-code-inner js-file-line"><span class="pl-kos">&lt;</span><span class="pl-ent">label</span> <span class="pl-c1">class</span>=&#8221;<span class="pl-s">screen-reader-text</span>&#8221; <span class="pl-c1">for</span>=&#8221;<span class="pl-s">s</span>&#8220;<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;</span>?php _e( &#8216;Search for:&#8217;, &#8216;woocommerce&#8217; ); ?<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">label</span><span class="pl-kos">&gt;</span></td>
</tr>
<tr>
<td id="file-wc-product-search-form-html-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-product-search-form-html-LC3" class="blob-code blob-code-inner js-file-line"><span class="pl-kos">&lt;</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>=&#8221;<span class="pl-s">search</span>&#8221; <span class="pl-c1">class</span>=&#8221;<span class="pl-s">search-field</span>&#8221; <span class="pl-c1">placeholder</span>=&#8221;<span class="pl-s">&lt;?php echo esc_attr_x( &#8216;Search Products&amp;hellip;&#8217;, &#8216;placeholder&#8217;, &#8216;woocommerce&#8217; ); ?&gt;</span>&#8221; <span class="pl-c1">value</span>=&#8221;<span class="pl-s">&lt;?php echo get_search_query(); ?&gt;</span>&#8221; <span class="pl-c1">name</span>=&#8221;<span class="pl-s">s</span>&#8221; <span class="pl-c1">title</span>=&#8221;<span class="pl-s">&lt;?php echo esc_attr_x( &#8216;Search for:&#8217;, &#8216;label&#8217;, &#8216;woocommerce&#8217; ); ?&gt;</span>&#8221; /&gt;</td>
</tr>
<tr>
<td id="file-wc-product-search-form-html-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-product-search-form-html-LC4" class="blob-code blob-code-inner js-file-line"><span class="pl-kos">&lt;</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>=&#8221;<span class="pl-s">submit</span>&#8221; <span class="pl-c1">value</span>=&#8221;<span class="pl-s">&lt;?php echo esc_attr_x( &#8216;Search&#8217;, &#8216;submit button&#8217;, &#8216;woocommerce&#8217; ); ?&gt;</span>&#8221; /&gt;</td>
</tr>
<tr>
<td id="file-wc-product-search-form-html-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-product-search-form-html-LC5" class="blob-code blob-code-inner js-file-line"><span class="pl-kos">&lt;</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>=&#8221;<span class="pl-s">hidden</span>&#8221; <span class="pl-c1">name</span>=&#8221;<span class="pl-s">post_type</span>&#8221; <span class="pl-c1">value</span>=&#8221;<span class="pl-s">product</span>&#8221; /&gt;</td>
</tr>
<tr>
<td id="file-wc-product-search-form-html-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-product-search-form-html-LC6" class="blob-code blob-code-inner js-file-line"><span class="pl-kos">&lt;/</span><span class="pl-ent">form</span><span class="pl-kos">&gt;</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div><p>The post <a href="https://help.codibu.com/blog/overriding-the-product-search-box-widget/">Overriding the product search box (widget)</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/overriding-the-product-search-box-widget/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Conditional Tags</title>
		<link>https://help.codibu.com/blog/conditional-tags-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=conditional-tags-2</link>
					<comments>https://help.codibu.com/blog/conditional-tags-2/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Sun, 08 Nov 2020 16:13:50 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/conditional-tags/</guid>

					<description><![CDATA[<p>What are “conditional tags”? The conditional tags of WooCommerce and WordPress can be used in your template files to change what content is displayed based on what conditions the<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/conditional-tags-2/">Conditional Tags</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2 id="section-1">What are “conditional tags”?</h2>
<p>The conditional tags of WooCommerce and WordPress can be used in your template files to change what content is displayed based on what <em>conditions</em> the page matches. For example, you may want to display a snippet of text above the shop page. With the <code>is_shop()</code> conditional tag, you can.</p>
<p>Because WooCommerce uses custom post types, you can also use many of WordPress’ conditional tags. See: http://codex.wordpress.org/Conditional_Tags for a list of the tags included with WordPress.</p>
<div class="woo-sc-box note   "><b>Note</b>: You can only use conditional query tags after the <code>posts_selection</code><em> </em>action hook in WordPress (the <code>wp</code> action hook is the first one through which you can use these conditionals). For themes, this means the conditional tag will never work properly if you are using it in the body of functions.php.</div>
<h2 id="section-2">Available conditional tags</h2>
<p>All conditional tags test whether a condition is met, and then return either <code>TRUE</code> or <code>FALSE</code>. <strong>Conditions under which tags output <code>TRUE</code> are listed below the conditional tags</strong>.</p>
<p>The list below holds the main conditional tags. To see all conditional tags, visit the WooCommerce API Docs.</p>
<h3 id="section-3">WooCommerce page</h3>
<dl>
<dt><code>is_woocommerce()</code></dt>
<dd>Returns true if on a page which uses WooCommerce templates (cart and checkout are standard pages with shortcodes and thus are not included).</dd>
</dl>
<h3 id="section-4">Main shop page</h3>
<dl>
<dt><code>is_shop()</code></dt>
<dd>Returns true when on the product archive page (shop).</dd>
</dl>
<h3 id="section-5">Product category page</h3>
<dl>
<dt><code>is_product_category()</code></dt>
<dd>Returns true when viewing a product category archive.</dd>
<dt><code>is_product_category( 'shirts' )</code></dt>
<dd>When the product category page for the ‘shirts’ category is being displayed.</dd>
<dt><code>is_product_category( array( 'shirts', 'games' ) )</code></dt>
<dd>When the product category page for the ‘shirts’ or ‘games’ category is being displayed.</dd>
</dl>
<h3 id="section-6">Product tag page</h3>
<dl>
<dt><code>is_product_tag()</code></dt>
<dd>Returns true when viewing a product tag archive</dd>
<dt><code>is_product_tag( 'shirts' )</code></dt>
<dd>When the product tag page for the ‘shirts’ tag is being displayed.</dd>
<dt><code>is_product_tag( array( 'shirts', 'games' ) )</code></dt>
<dd>When the product tag page for the ‘shirts’ or ‘games’ tags is being displayed.</dd>
</dl>
<h3 id="section-7">Single product page</h3>
<dl>
<dt><code>is_product()</code></dt>
<dd>Returns true on a single product page. Wrapper for is_singular.</dd>
</dl>
<h3 id="section-8">Cart page</h3>
<dl>
<dt><code>is_cart()</code></dt>
<dd>Returns true on the cart page.</dd>
</dl>
<h3 id="section-9">Checkout page</h3>
<dl>
<dt><code>is_checkout()</code></dt>
<dd>Returns true on the checkout page.</dd>
</dl>
<h3 id="section-10">Customer account pages</h3>
<dl>
<dt><code>is_account_page()</code></dt>
<dd>Returns true on the customer’s account pages.</dd>
</dl>
<h3 id="section-11">Endpoint</h3>
<dl>
<dt><code>is_wc_endpoint_url()</code></dt>
<dd>Returns true when viewing a WooCommerce endpoint</dd>
<dt><code>is_wc_endpoint_url( 'order-pay' )</code></dt>
<dd>When the endpoint page for order pay is being displayed.</dd>
<dt><code>is_wc_endpoint_url( 'order-received' )</code></dt>
<dd>When the endpoint page for order received is being displayed.</dd>
<dt><code>is_wc_endpoint_url( 'view-order' )</code></dt>
<dd>When the endpoint page for view order is being displayed.</dd>
<dt><code>is_wc_endpoint_url( 'edit-account' )</code></dt>
<dd>When the endpoint page for edit account is being displayed.</dd>
<dt><code>is_wc_endpoint_url( 'edit-address' )</code></dt>
<dd>When the endpoint page for edit address is being displayed.</dd>
<dt><code>is_wc_endpoint_url( 'lost-password' )</code></dt>
<dd>When the endpoint page for lost password is being displayed.</dd>
<dt><code>is_wc_endpoint_url( 'customer-logout' )</code></dt>
<dd>When the endpoint page for customer logout  is being displayed.</dd>
<dt><code>is_wc_endpoint_url( 'add-payment-method' )</code></dt>
<dd>When the endpoint page for add payment method is being displayed.</dd>
</dl>
<h3 id="section-12">Ajax request</h3>
<dl>
<dt><code>is_ajax()</code></dt>
<dd>Returns true when the page is loaded via ajax.</dd>
</dl>
<h2 id="section-13">Working example</h2>
<p>The example illustrates how you would display different content for different categories.</p>
<div id="gist88076185" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-display-different-content-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-display-different-content-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-display-different-content-php-LC1" class="blob-code blob-code-inner js-file-line">if ( is_product_category() ) {</td>
</tr>
<tr>
<td id="file-wc-display-different-content-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-display-different-content-php-LC2" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-display-different-content-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-display-different-content-php-LC3" class="blob-code blob-code-inner js-file-line">if ( is_product_category( &#8216;shirts&#8217; ) ) {</td>
</tr>
<tr>
<td id="file-wc-display-different-content-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-display-different-content-php-LC4" class="blob-code blob-code-inner js-file-line">echo &#8216;Hi! Take a look at our sweet tshirts below.&#8217;;</td>
</tr>
<tr>
<td id="file-wc-display-different-content-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-display-different-content-php-LC5" class="blob-code blob-code-inner js-file-line">} elseif ( is_product_category( &#8216;games&#8217; ) ) {</td>
</tr>
<tr>
<td id="file-wc-display-different-content-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-display-different-content-php-LC6" class="blob-code blob-code-inner js-file-line">echo &#8216;Hi! Hungry for some gaming?&#8217;;</td>
</tr>
<tr>
<td id="file-wc-display-different-content-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-display-different-content-php-LC7" class="blob-code blob-code-inner js-file-line">} else {</td>
</tr>
<tr>
<td id="file-wc-display-different-content-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-display-different-content-php-LC8" class="blob-code blob-code-inner js-file-line">echo &#8216;Hi! Check our our products below.&#8217;;</td>
</tr>
<tr>
<td id="file-wc-display-different-content-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-display-different-content-php-LC9" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-display-different-content-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-display-different-content-php-LC10" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-display-different-content-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-display-different-content-php-LC11" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div><p>The post <a href="https://help.codibu.com/blog/conditional-tags-2/">Conditional Tags</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/conditional-tags-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>CSS Structure</title>
		<link>https://help.codibu.com/blog/css-structure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-structure</link>
					<comments>https://help.codibu.com/blog/css-structure/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Sun, 08 Nov 2020 16:13:25 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/css-structure/</guid>

					<description><![CDATA[<p>Structure Inside the assets/css/ directory, you will find the stylesheets responsible for the default WooCommerce layout styles. Files to look for are woocommerce.scss and woocommerce.css. woocommerce.css is the minified stylesheet – it’s<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/css-structure/">CSS Structure</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2 id="section-1">Structure</h2>
<p>Inside the <code>assets/css/</code> directory, you will find the stylesheets responsible for the default WooCommerce layout styles.</p>
<p>Files to look for are <code>woocommerce.scss</code> and <code>woocommerce.css</code>.</p>
<ul>
<li><code>woocommerce.css</code> is the minified stylesheet – it’s the CSS without any of the spaces, indents, etc. This makes the file very fast to load. This file is referenced by the plugin and declares all WooCommerce styles.</li>
<li><code>woocommerce.scss</code> is not directly used by the plugin, but by the team developing WooCommerce. We use SASS in this file to script the CSS in the first file easier and faster.</li>
</ul>
<p>The CSS is written to make the default layout compatible with as many themes as possible by using % widths for all layout styles. It is, however, likely that you’ll want to make your own adjustments.</p>
<h2 id="section-2">Modifications</h2>
<p class="p1"> </p>
<div class="woo-sc-box note   "><b>Note:</b> We are unable to provide support for customizations under our <a href="https://help.codibu.com/blog/kb/support-policy/"><span class="s2">Support Policy</span></a>. If you are unfamiliar with code/templates and resolving potential conflicts, select a <a href="https://woocommerce.com/customizations/"><span class="s2">WooExpert or Developer</span></a>  for assistance.</div>
<p>&nbsp;</p>
<p>To avoid upgrade issues, we advise not editing these files but rather use them as a point of reference.</p>
<p>If you just want to make changes, we recommend adding some overriding styles to your theme stylesheet. For example, add the following to your theme stylesheet to make WooCommerce buttons black instead of the default color:</p>
<pre>a.button, 
button.button, 
input.button, 
#review_form #submit {
  background:black; 
}</pre>
<p>WooCommerce also outputs the theme name (plus other useful information, such as which type of page is being viewed) as a class on the body tag, which can be useful for overriding styles.</p>
<h2 id="section-3">Disabling WooCommerce styles</h2>
<p>If you plan to make major changes, then you may prefer your theme not reference the WooCommerce stylesheet at all. You can tell WooCommerce to not use the default <code>woocommerce.css</code>. <a href="https://help.codibu.com/blog/kb/disable-the-default-stylesheet">See the following tutorial for disabling WooCommerce style sheets.</a></p>
<h2 id="section-4">Contributing</h2>
<p>If you are contributing to WooCommerce core and need to edit the style, please edit the Sass files and then compile them by using Grunt. To know more about what Grunt tasks we use, check out the file <code>Gruntfile.js</code> inside the root of WooCommerce. You can read more about Grunt here.</p><p>The post <a href="https://help.codibu.com/blog/css-structure/">CSS Structure</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/css-structure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Template structure &#038; Overriding templates via a theme</title>
		<link>https://help.codibu.com/blog/template-structure-overriding-templates-via-a-theme/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=template-structure-overriding-templates-via-a-theme</link>
					<comments>https://help.codibu.com/blog/template-structure-overriding-templates-via-a-theme/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Sun, 08 Nov 2020 16:12:24 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/template-structure-overriding-templates-via-a-theme/</guid>

					<description><![CDATA[<p>WooCommerce template files contain the markup and template structure for frontend and HTML emails of your store. When you open these files, you will notice they all contain hooks that allow you to add/move<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/template-structure-overriding-templates-via-a-theme/">Template structure & Overriding templates via a theme</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>WooCommerce template files contain the <strong>markup</strong> and <strong>template structure</strong> for <strong>frontend and HTML emails</strong> of your store.</p>
<p>When you open these files, you will notice they all contain <strong>hooks</strong> that allow you to add/move content without needing to edit template files themselves. This method protects against upgrade issues, as the template files can be left completely untouched.</p>
<p>Template files can be found within the <code><strong>/woocommerce/templates/</strong></code> directory:</p>
<figure class="wp-block-table">
<table style="width: 26.3421%; height: 437px;">
<thead>
<tr style="height: 23px;">
<th style="width: 36.5145%; height: 23px;">VERSION</th>
<th style="width: 60.5809%; height: 23px;">FILES</th>
</tr>
</thead>
<tbody>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v.4.6.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v.4.5.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v.4.4.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v4.3.0</td>
<td style="width: 60.5809%; height: 23px;">View templates files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v4.2.0</td>
<td style="width: 60.5809%; height: 23px;">View templates files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v4.1.0</td>
<td style="width: 60.5809%; height: 23px;">View templates files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v4.0.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v3.9.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v3.8.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v3.7.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v3.6.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v3.5.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v3.4.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v3.3.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v3.2.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v3.1.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v3.0.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
<tr style="height: 23px;">
<td style="width: 36.5145%; height: 23px;">v2.6.0</td>
<td style="width: 60.5809%; height: 23px;">View template files</td>
</tr>
</tbody>
</table>
</figure>
<h2 id="section-1">How to Edit Files</h2>
<p>Edit files in an <strong>upgrade-safe way</strong> using <strong>overrides</strong>. Copy the template into a directory within your theme named <code>/woocommerce</code> keeping the same file structure but removing the <code>/templates/</code> subdirectory.</p>
<p>Example: To override the admin order notification, copy: <code>wp-content/plugins/woocommerce/templates/emails/admin-new-order.php</code> to <code>wp-content/themes/yourtheme/woocommerce/emails/admin-new-order.php</code></p>
<p>The copied file will now override the WooCommerce default template file.</p>
<p><strong>Warning</strong>: Do not edit these files within the core plugin itself as they are overwritten during the upgrade process and any customizations will be lost. For more detailed information, see <a href="https://help.codibu.com/blog/kb/fixing-outdated-woocommerce-templates/" rel="noreferrer noopener">Fixing Outdated WooCommerce Templates</a>.</p>
<h2 id="section-2">For Custom Templates</h2>
<p>If you are a theme developer or using a theme with custom templates, you must declare WooCommerce theme support using the <code>add_theme_support</code> function. See Declaring WooCommerce Support in Themes at GitHub.</p>
<p>If your theme has a <code>woocommerce.php</code> file, you will be unable to override the <code>woocommerce/archive-product.php</code> custom template in your theme, as <code>woocommerce.php</code> has priority over other template files. This is intended to prevent display issues.</p><p>The post <a href="https://help.codibu.com/blog/template-structure-overriding-templates-via-a-theme/">Template structure & Overriding templates via a theme</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/template-structure-overriding-templates-via-a-theme/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
