Skip to content

Instantly share code, notes, and snippets.

@tdmrhn
tdmrhn / remove-author-meta-link.php
Created April 18, 2024 09:29
Wordpress Remove Author Meta Link
@tdmrhn
tdmrhn / blc-2-woo-quantity-type-2-remove-button-spaces.css
Created April 17, 2024 09:54
Blocksy 2 Woo Quantity Type 2 Remove Button Spaces
.quantity[data-type="type-2"] .ct-increase {
inset-inline-end: 0;
}
.quantity[data-type="type-2"] .ct-decrease {
inset-inline-start: 0;
}
.quantity[data-type="type-2"] .ct-increase, .quantity[data-type="type-2"] .ct-decrease {
top: 0;
width: calc(var(--quantity-height, 55px)/1.3);
height: 100%;
@tdmrhn
tdmrhn / blc-2-single-posts-custom-tag-design.css
Created April 7, 2024 07:20
Blocksy 2 Single Posts Custom Tag Design
.entry-tags > a {
--price-tag-height: 25px;
--price-border-radius: 4px;
position: relative;
display: inline-flex;
height: var(--price-tag-height);
margin-left: calc(var(--price-tag-height) / 2);
padding: 0 calc(var(--price-tag-height) / 2);
color: #fff;
@tdmrhn
tdmrhn / blc-2-disable-cart-checkout-buttons.css
Created April 5, 2024 08:09
Blocksy 2 Disable cart and checkout buttons on opposite pages
body.woocommerce-cart .woocommerce-mini-cart__buttons .wc-forward:not(.checkout),
body.woocommerce-checkout .woocommerce-mini-cart__buttons .checkout
{ display: none; }
body.woocommerce-cart .woocommerce-mini-cart__buttons,
body.woocommerce-checkout .woocommerce-mini-cart__buttons
{ grid-template-columns: 1fr; }
@tdmrhn
tdmrhn / blc-2-add-quantity+atc-to-product-cards.php
Created March 28, 2024 07:19
Blocksy 2 Add Quantity + Add to Card button to Product Cards via Content Blocks Element
<?php
// Add this to Content Blocks > Hook > No Condition or Location
// Call it through Customizer > Product Archives > Card Options > Enable Content Block Element > Select the Hook name in drop down
if ( is_product() || is_shop() || is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) {
global $product;
if ( ! $product->is_sold_individually() && 'variable' != $product->product_type && $product->is_purchasable() && $product->is_in_stock() ) {
echo '<div class="dhn-atc-wrap">';
woocommerce_quantity_input( array( 'min_value' => 1, 'max_value' => $product->backorders_allowed() ? '' : $product->get_stock_quantity() ) );
echo '<a href="' . esc_url( $product->add_to_cart_url() ) . '" data-quantity="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="' . esc_attr( $product->get_id() ) . '" aria-label="' . esc_attr( sprintf( __( 'Add to cart: %s', 'woocommerce' ), $product->get_name() ) ) . '" aria-describedby="" rel="nofollow">' . esc_html( $p
@tdmrhn
tdmrhn / blc-2-cpt-card-hover-background-transition-effect.css
Created March 25, 2024 22:27
Blocksy Card Hover background transition from left
.entry-card.type-project {overflow: hidden; position: relative }
.entry-card.type-project::after { position: absolute; content: ""; top:0; left:-100%; width: 100%; height: 100%; background-color:var(--theme-palette-color-1); z-index: 1; transition: all 1s ease; }
.entry-card.type-project:hover::after { left: 0; }
@tdmrhn
tdmrhn / woo-show-featured-products-first-in-query.php
Created March 16, 2024 10:10
WooCommerce Show Featured Products First in Query
@tdmrhn
tdmrhn / blc-2-customizer-grid-bento-grid.css
Created March 10, 2024 17:14
Blocksy 2: Easy Bento Grid for Archives with Customizer Grid Type
.entries[data-layout="grid"] article:first-child,
.entries[data-layout="grid"] article:nth-child(8n),
.entries[data-layout="grid"] article:nth-child(23n),
.entries[data-layout="grid"] article:nth-child(79n),
.entries[data-layout="grid"] article:nth-child(91n) {
grid-column: span 2;
}
.entries[data-layout="grid"] article:first-child,
.entries[data-layout="grid"] article:nth-child(7n),
.entries[data-layout="grid"] article:nth-child(45n),
@tdmrhn
tdmrhn / blc-2-customizer-grid-bento-grid.css
Created March 10, 2024 16:16
Blocksy 2: Easy Bento Grid for Archives with Customizer Grid Type
.entries[data-layout="grid"] article:first-child,
.entries[data-layout="grid"] article:nth-child(7n+1) {
grid-column: span 2;
}
.entries[data-layout="grid"] article:first-child,
.entries[data-layout="grid"] article:nth-child(5n+1) {
grid-row: span 2;
}
@tdmrhn
tdmrhn / blc-2-advanced-posts-bento-grid.css
Created March 6, 2024 15:10
Blocksy 2: Easy Bento Grid with Advanced Posts Block
.ct-post-grid article:first-child,
.ct-post-grid article:nth-child(7) {
grid-column: span 2;
}
.ct-post-grid article:first-child,
.ct-post-grid article:nth-child(5) {
grid-row: span 2;
}
.ct-post-grid article .wp-block-cover {
min-height: 250px;