Skip to content

Instantly share code, notes, and snippets.

View jameskoster's full-sized avatar
🍕

James Koster jameskoster

🍕
View GitHub Profile
@jameskoster
jameskoster / functions.php
Last active August 15, 2023 14:04
Display featured image as header background
add_action( 'wp_head', 'jk_header_background', 999 );
function jk_header_background() {
global $post;
$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );
if ( $post_thumbnail_id ) {
?>
@jameskoster
jameskoster / pattern.html
Created June 10, 2021 10:34
Offset gallery with fixed background & quote
<!-- wp:cover {"url":"https://jameskoster.design/wp-content/uploads/2021/06/image-from-rawpixel-id-3064488-jpeg.jpg","id":507,"hasParallax":true,"dimRatio":70,"overlayColor":"primary","contentPosition":"center center","align":"full","style":{"spacing":{"padding":{"top":"10vw","right":"10vw","bottom":"10vw","left":"10vw"}}}} -->
<div class="wp-block-cover alignfull has-background-dim-70 has-primary-background-color has-background-dim has-parallax" style="padding-top:10vw;padding-right:10vw;padding-bottom:10vw;padding-left:10vw;background-image:url(https://jameskoster.design/wp-content/uploads/2021/06/image-from-rawpixel-id-3064488-jpeg.jpg)"><div class="wp-block-cover__inner-container"><!-- wp:columns {"verticalAlignment":"top","align":"full"} -->
<div class="wp-block-columns alignfull are-vertically-aligned-top"><!-- wp:column {"verticalAlignment":"top","width":"72%","style":{"spacing":{"padding":{"right":"4vw","top":"0vw","bottom":"0vw","left":"0vw"}}}} -->
<div class="wp-block-column is-vertically-aligned-t
Dec 14 06:49:43 vvv postfix/pickup[17603]: 5A3B660ACC: uid=0 from=<root>
Dec 14 06:49:43 vvv postfix/cleanup[18638]: 5A3B660ACC: message-id=<20171214064943.5A3B660ACC@vvv>
Dec 14 06:49:43 vvv postfix/qmgr[1305]: 5A3B660ACC: from=<root@vvv>, size=894, nrcpt=1 (queue active)
Dec 14 06:49:43 vvv postfix/local[18640]: 5A3B660ACC: to=<root@vvv>, orig_to=<root>, relay=local, delay=0.03, delays=0.02/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Dec 14 06:49:43 vvv postfix/qmgr[1305]: 5A3B660ACC: removed
Dec 14 07:09:01 vvv CRON[18665]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Dec 14 07:09:01 vvv CRON[18666]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean ] && [ -d /var/lib/php5 ] && /usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime))
Dec 14 07:17:01 vvv CRON[18730]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Dec 14 07:39:01 vvv CRON[18872]: (root) CMD ( [ -x
@jameskoster
jameskoster / functions.php
Created January 16, 2017 14:39
WooCommerce disable magnification / zoom
add_action( 'wp_enqueue_scripts', 'jk_disable_magnification' );
function jk_disable_magnification() {
wp_dequeue_script( 'zoom' );
}
@jameskoster
jameskoster / functions.php
Created June 15, 2016 15:18
Bookshop - change the author attribute
add_filter( 'bookshop_author_attribute', 'jk_new_author_attribute' );
function jk_new_author_attribute( $attribute ) {
$attribute = 'pa_newattribute';
return $attribute;
}
@jameskoster
jameskoster / storefront-logo-size-adjust-example.css
Last active February 24, 2020 11:51 — forked from mattyza/storefront-logo-size-adjust-example.css
Adjust the dimensions of the header logo in the Storefront theme.
@media screen and (min-width: 768px) {
.site-header .site-branding, .site-header .site-logo-anchor, .site-header .site-logo-link, .site-header .custom-logo-link {
width: 21%; /* Adjust this percentage up or down to make the logo larger or smaller. */
}
}
@jameskoster
jameskoster / functions.php
Created May 11, 2016 17:52
Storefront - remove handheld navigation bar
add_action( 'init', 'jk_remove_storefront_handheld_footer_bar' );
function jk_remove_storefront_handheld_footer_bar() {
remove_action( 'storefront_footer', 'storefront_handheld_footer_bar', 999 );
}
@jameskoster
jameskoster / style.css
Created May 9, 2016 09:48
Storefront - add an icon to the home link
.storefront-handheld-footer-bar ul li.home > a:before {
content: "\f015";
}
@jameskoster
jameskoster / functions.php
Last active April 27, 2021 22:39
Storefront add a link to the handheld nav bar
add_filter( 'storefront_handheld_footer_bar_links', 'jk_add_home_link' );
function jk_add_home_link( $links ) {
$new_links = array(
'home' => array(
'priority' => 10,
'callback' => 'jk_home_link',
),
);
$links = array_merge( $new_links, $links );
@jameskoster
jameskoster / functions.php
Last active May 9, 2016 09:31
Storefront - remove account link from handheld footer bar
add_filter( 'storefront_handheld_footer_bar_links', 'jk_remove_handheld_footer_links' );
function jk_remove_handheld_footer_links( $links ) {
unset( $links['my-account'] );
unset( $links['search'] );
unset( $links['cart'] );
return $links;
}