Skip to content

Instantly share code, notes, and snippets.

@squill
squill / A Blocks
Created May 16, 2019 07:52
Uncaught SyntaxError: Unexpected token =>
~/wp-content/plugins/atomic-blocks/dist/assets/js/dismiss.js?ver=1556813107:6
When that is put into a browser, it gives this:
(function($) {
$(document).ready(function() {
const elems = document.querySelectorAll('.ab-block-notice.ab-dismissable[data-id]');
elems.forEach(el => {
@squill
squill / 2019-full-width-text
Created January 18, 2019 08:39
2019 WordPress theme - text full width
/* 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;
}
@squill
squill / hide-categories.php
Last active January 11, 2019 13:20
Hide Product Categories
function custom_pre_get_posts_query( $q ) {
$tax_query = (array) $q->get( 'tax_query' );
$tax_query[] = array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => array( 'PUT THE CATEGORY TO HIDE HERE' ), // Don't display products in the this category on the shop page.
'operator' => 'NOT IN'
);
$q->set( 'tax_query', $tax_query );
}