This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.alignwide { | |
max-width: 75%; | |
width: 75%; | |
margin-left: auto; | |
margin-right: auto; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.entry-content > *:not( .alignwide ):not( .alignfull ) { | |
max-width: 50%; | |
width: 50%; | |
margin-left: auto; | |
margin-right: auto; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sets up theme defaults and registers support for various WordPress features. | |
* | |
* Note that this function is hooked into the after_setup_theme hook, which | |
* runs before the init hook. The init hook is too late for some features, such | |
* as indicating support for post thumbnails. | |
*/ | |
function twentyseventeen_setup() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_theme_support( 'align-wide' ); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Wrapper function for add_theme_support setup | |
function mytheme_setup_theme_supported_features() { | |
// Add theme support for wide align blocks | |
add_theme_support( 'align-wide' ); | |
} | |
// Hook wrapper function into WP once theme is ready |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Deconstruct just the __ function from wp.i18n global object | |
const { __ } = wp.i18n; | |
// Just pass in the text to make it available for translation | |
__( 'This text can be translated', 'textdomain' ); | |
// If used within JSX, you may need to do something like this | |
{ __( 'Translate my JSX string', 'textdomain' ) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mytheme_block_templates( $args, $post_type ) { | |
// Only add template to 'post' post type | |
// Change for your post type: eg 'page', 'event', 'product' | |
if ( 'post' == $post_type ) { | |
// Optionally lock templates from further changes | |
// Change to 'insert' to allow adding other blocks, but lock defined blocks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the theme stylesheets | |
function theme_styles() | |
{ | |
// Example of loading a jQuery slideshow plugin just on the homepage | |
wp_register_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css' ); | |
// Load all of the styles that need to appear on all pages | |
wp_enqueue_style( 'main', get_template_directory_uri() . '/style.css' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
Button, | |
Dashicon, | |
Tooltip, | |
} = wp.components; | |
// Wrap the Tooltip component around whatever you want to activate the tooltip on hover | |
<Tooltip | |
text={ __( 'Add Tooltip Text Here' ) } | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_theme_support( 'gutenberg', [ | |
'wide-images' => true, | |
'colors' => [ | |
'#556270', | |
'#4ECDC4', | |
'#C7F464', | |
'#FF6B6B', | |
'#C44D58', | |
] |