This file contains hidden or 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_create_post_type() { | |
register_post_type( 'mytheme_event', | |
[ | |
'labels' => [ | |
'name' => __( 'Events' ), | |
'singular_name' => __( 'Event' ) | |
], | |
'public' => true, |
This file contains hidden or 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
jQuery(document).ready(function(){ | |
// Make YouTube video blocks responsive | |
jQuery(".wp-block-embed-youtube").fitVids(); | |
// Add lightboxes to gallery blocks linking to media file | |
jQuery(".blocks-gallery-item a").swipebox(); | |
}); |
This file contains hidden or 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 | |
/** | |
* Enqueue custom block JavaScript on the frontend only | |
*/ | |
function mytheme_frontend_block_scripts() { | |
// Enqueue fitvids JS library from CDN for responsive video embeds | |
wp_enqueue_script( 'fitvids', 'https://cdnjs.cloudflare.com/ajax/libs/fitvids/1.2.0/jquery.fitvids.min.js', array('jquery') ); |
This file contains hidden or 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 | |
/** | |
* Enqueue block styles on frontend and in editor | |
* | |
*/ | |
function mytheme_block_styles() { | |
wp_enqueue_style( 'mytheme-blocks', get_stylesheet_directory_uri() . '/css/blocks.css' ); |
This file contains hidden or 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
/* Style all header blocks that appear within the main content area */ | |
.entry-content h1, | |
.entry-content h2, | |
.entry-content h3, | |
.entry-content h4, | |
.entry-content h5, | |
.entry-content h6 { | |
font-family: futura, san-serif; | |
text-transform: uppercase; | |
} |
This file contains hidden or 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
/* Add bottom margin to cover images */ | |
.wp-block-cover-image { | |
margin-bottom: 1rem; | |
} |
This file contains hidden or 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
@media only screen | |
and (max-width: 480px) { | |
body.page-two-column:not(.archive) #primary .entry-header, | |
.entry-content > *:not( .alignwide ):not( .alignfull ) { | |
max-width: 75%; | |
width: 75%; | |
} | |
.alignwide { | |
max-width: 90%; | |
width: 90%; |
This file contains hidden or 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 hidden or 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
body.page-two-column:not(.archive) #primary .entry-header, | |
.entry-content > *:not( .alignwide ):not( .alignfull ) { | |
max-width: 50%; | |
width: 50%; | |
margin-left: auto; | |
margin-right: auto; | |
} |
This file contains hidden or 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
.site-content .wrap, | |
.has-sidebar:not(.error404) #primary, | |
.has-sidebar #secondary, | |
body:not(.has-sidebar):not(.page-one-column) .page-header, | |
body.has-sidebar.error404 #primary .page-header, | |
body.page-two-column:not(.archive) #primary .entry-header, | |
body.page-two-column.archive:not(.has-sidebar) #primary .page-header, | |
.blog:not(.has-sidebar) #primary article, | |
.archive:not(.page-one-column):not(.has-sidebar) #primary article, | |
.search:not(.has-sidebar) #primary article, |