Twenty Nineteen Theme Full Width

The default setting for the text for the Twenty Nineteen theme stretches only partway across the page, and yet the theme does not allow for sidebar widgets.

The result is a theme with text that takes up part of the page, with half the page empty all the way down it.

I wasn’t interested in trying to find a way to introduce a sidebar with widgets. I wanted the text to take up the full width, and this is the CSS I am using to accomplish that.

/* to make page content full width */
body.page .entry .entry-content > *, .entry .entry-summary > * {
        max-width: none;
}

/* to make posts content full width */
.entry .entry-content p
{
        max-width: none;
}

/* to make shop content full width */
.woocommerce .content-area .site-main
{
        max-width: none;
}

Here’s the raw code: 2019-full-width-text

Hide Product Categories

If you want to pre-approve your customers (such as in a trade-only shop) then you might want to disable the visibility of pricing as the ability for visitors to buy your products.

Catalog Visibility Options

The Catalog Visibility Options plugin will do this and also let you choose which user roles can see products and product categories.

Therefore, if you want to take a category out of the shop, use the plugin to do that.

PHP code

Otherwise there is this code that I saw on Business Bloomer but the code was in the comments, and is from Jonathan from Inspired Earth

function custom_pre_get_posts_query( $q ) { $tax_query = (array) $q->get( 'tax_query' ); $tax_query[] = array( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => array( 'CATEGORY-TO-HIDE' ), // Don't display products in the this category on the shop page. 'operator' => 'NOT IN' ); $q->set( 'tax_query', $tax_query ); } add_action( 'woocommerce_product_query', 'custom_pre_get_posts_query' );

Here is the raw code

Where to put the code

I use the Code Snippets plugin (it’s in the WordPress repository) to contain snippets of php.

Debug, Health Check & Troubleshooting

The Health Check & Troubleshooting plugin is made by the WordPress.org community.

It has a debug function that checks common configuration errors and known issues in a WordPress setup, and highlights them.

It doesn’t solve them, but it gives you the information to tackle the issue.

Theme and Plugin Conflicts

When you activate the Troubleshooting feature, it reverts your site to a default WordPress theme like Twenty Seventeen and deactivates all your plugins.

You can then turn your chosen theme back on to see whether the issue reasserts itself.

If it does then you know it’s a theme-specific issue.

If not, then you can re-activate your plugins one by one until you see the issue reappear. In that way you can resolve plugin conflict issues.

The neat part is that it does it only for you as the logged in admin. Anyone visiting the site sees your usual setup.

Take a full backup before you start…