Skip to content

Instantly share code, notes, and snippets.

@Shininglow
Shininglow / extra.js
Created August 21, 2019 14:17
extra gutenberg block js
wp.blocks.registerBlockType('my_new-block', {
title: 'My Extra Block',
icon: 'heart',
category: 'common',
attributes: {
content: {type: 'string'}
},
edit: function(props) {
function somename(event) {
props.setAttributes({content: event.target.value})
@Shininglow
Shininglow / extra.php
Created August 13, 2019 15:15
For a new Gutenberg block
<?php
/**
*Plugin name: Extra
*Author: My name
*Version: 1.0.0
*/
function loadMyBlockFiles() {
wp_enqueue_script(
'my-test-text',
@Shininglow
Shininglow / responsive-blocks.css
Created July 9, 2019 09:17
responsive-blocks
@media (max-width: 764px) {
.wp-block-columns {
display: block;
}
}
@Shininglow
Shininglow / astra-footer.php
Created April 12, 2019 14:06
astra-footer.php
@Shininglow
Shininglow / astra-header.php
Created April 12, 2019 14:02
astra-header.php
<?php
$done=false;
if ( function_exists( 'jet_theme_core') ) {
$done = jet_theme_core() ->do_location( 'header' );
}
?>
<?php
if ( ! $done ) {
astra_header();
}
<header class="entry-header">
<?php $utility->attributes->get_title( array(
'class' => 'entry-title',
'html' => '<h3 %1$s>%4$s</h3>',
'echo' => true,
) );
?>
</header>
<header class="entry-header">
<?php $utility->attributes->get_title( array(
'class' => 'entry-title screen-reader-text',
'html' => '<h1 %1$s>%4$s</h1>',
'echo' => true,
) );
?>
</header>
.jet-carousel-wrap.jet-equal-cols .jet-carousel__item>*:last-child {
display: flex;
flex-direction: column;
}
.jet-carousel-wrap.jet-equal-cols .jet-carousel__item .jet-carousel__item-link, .jet-carousel-wrap.jet-equal-cols .jet-carousel__item .jet-banner, .jet-carousel-wrap.jet-equal-cols .jet-carousel__item .jet-banner__link {
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
// Display 25 products per page
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 12;' ), 20 );
add_filter( 'edit_post_link', '__return_false' );