Skip to content

Instantly share code, notes, and snippets.

@tdmrhn
tdmrhn / blc-2-product-card-actions-icon-color.css
Created November 30, 2023 15:46
Blocksy 2 Product Card Type 1 Action Buttons Colors
View blc-2-product-card-actions-icon-color.css
.ct-woo-card-extra[data-type="type-1"] .ct-button {
--theme-icon-color: var(--theme-palette-color-1);
--trigger-background: var(--theme-palette-color-5);
--theme-icon-hover-color: var(--theme-palette-color-1);
--trigger-hover-background: var(--theme-palette-color-8);
}
@tdmrhn
tdmrhn / blc-2-product-card-3-always-show-buttons.css
Created November 28, 2023 16:27
Blocksy 2 > Products Type-3 Always show buttons under image
View blc-2-product-card-3-always-show-buttons.css
.ct-woo-card-extra[data-type="type-2"] {
opacity: 1;
position: relative;
order: 2;
margin-top: 10px;
inset-inline: 0px;
}
@tdmrhn
tdmrhn / wp-remove-all-profile-social.php
Created November 21, 2023 08:15
WP remove all social networks iin profile backend
View wp-remove-all-profile-social.php
<?php
add_action('init', function () {
//if (!current_user_can('manage_options')) { // Remove all contact methods for non-admin users
remove_all_filters('user_contactmethods');
//}
});
@tdmrhn
tdmrhn / blc-header-socials-add-tooltip.css
Last active October 27, 2023 06:26
Blocksy add tooltip to header social elements
View blc-header-socials-add-tooltip.css
.ct-header-socials a[aria-label] { position: relative; }
.ct-header-socials a[aria-label]::before { content: attr(aria-label); background-color: var(--official-color, var(--icon-hover-color, var(--paletteColor2))); color: var(--paletteColor8); border-radius: 5px; padding: 5px 20px; position: absolute; z-index: 9; top: 25px; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s; white-space: nowrap; }
.ct-header-socials a[aria-label]:hover::before { opacity: 1; }
@tdmrhn
tdmrhn / blc-single-product-gallery-shopify-style.css
Created October 25, 2023 10:51
Blocksy Shopify Style Single Product Gallery
View blc-single-product-gallery-shopify-style.css
@tdmrhn
tdmrhn / woo-change-shop-title.php
Created October 11, 2023 10:08
Change Woo Shop Page Title
View woo-change-shop-title.php
<?php
add_filter( 'document_title_parts', function ( $title ) {
if ( is_shop() && isset( $title['title'] ) ) {
$title['title'] = 'Products';
}
return $title;
});
@tdmrhn
tdmrhn / blc-product-reviews-rename-cpt.php
Created September 26, 2023 06:24
Blocksy Rename Product Reviews Extension
View blc-product-reviews-rename-cpt.php
<?php
add_action( 'init', function () {
global $wp_post_types;
if ( isset( $wp_post_types['blc-product-review'] ) ) {
$wp_post_types['blc-product-review']->label = 'Product Reviews';
$wp_post_types['blc-product-review']->labels->name = 'Product Reviews';
$wp_post_types['blc-product-review']->labels->singular_name = 'Product Review';
$wp_post_types['blc-product-review']->labels->menu_name = 'Product Reviews';
$wp_post_types['blc-product-review']->labels->all_items = 'All Product Reviews';
@tdmrhn
tdmrhn / blc-product-navigation-implement.php
Created September 18, 2023 06:05
Blocksy Posts Navigation to Product Single Page
View blc-product-navigation-implement.php
add_action('woocommerce_after_main_content', function () {
if (is_product()) {
echo blocksy_post_navigation();
}
}, 10);
add_action('wp_enqueue_scripts', function () {
if (is_product()) {
wp_enqueue_style('blocksy-post-navigation','/wp-content/themes/blocksy/static/bundle/posts-nav.min.css');
}
@tdmrhn
tdmrhn / blc-one-column-cart-checkout.css
Created September 13, 2023 07:58
Blocksy one column Cart and Checkout page
View blc-one-column-cart-checkout.css
.ct-woocommerce-cart-form, form.woocommerce-checkout { grid-template-columns: 1fr; grid-row-gap: 100px; }
@tdmrhn
tdmrhn / blc-change-product-loop-card-image-size-ratio.php
Created September 2, 2023 10:04
Blocksy Change Product Loop Card Image Size & Ratio
View blc-change-product-loop-card-image-size-ratio.php
<?php
add_filter('woocommerce_product_get_image', function ($image, $product, $size, $attr, $placeholder) {
if (has_term('custom-category', 'product_cat')) {
$image = blocksy_image([
'no_image_type' => 'woo',
'attachment_id' => $product->get_image_id(),
'size' => 'full',
'ratio' => '6/4',
'tag_name' => 'span',
]);