Skip to content

Instantly share code, notes, and snippets.

@tdmrhn
tdmrhn / subscribe-form-design-footer.css
Last active August 15, 2021 07:03
Copy CT Subscribe Form Footer
@tdmrhn
tdmrhn / whislist-change-slug.php
Created May 12, 2021 18:58
Blocksy Change Wishlist Slug
add_filter('blocksy:pro:woocommerce-extra:wish-list:slug', function ($mywlist) {
$mywlist = 'mywishlist';
return $mywlist;
});
@tdmrhn
tdmrhn / add-to-cart-redirect-to-single.php
Last active May 13, 2021 09:45
Add to Cart Redirect to Single Product Page
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
add_filter( 'woocommerce_loop_add_to_cart_link', 'replacing_add_to_cart_button', 10, 2 );
function replacing_add_to_cart_button( $button, $product ) {
$button = '<a class="ct-button" href="' . $product->get_permalink() . '">View product</a>';
return $button;
}
@tdmrhn
tdmrhn / blocksy-modal-buttons.html
Created May 18, 2021 10:36
Blocksy Modal Buttons
<a href="#search-modal" class="ct-header-search ct-button" data-id="search">Search</a>
<a href="#offcanvas" class="ct-header-trigger ct-button" data-id="trigger">Menu</a>
<a href="#account-modal" class="ct-header-account ct-button" data-state="out" data-id="account">Login</a>
@tdmrhn
tdmrhn / activate_category_page.php
Created May 19, 2021 06:19
Activate Category for Pages
<?php
function activate_category_page() {
// register_taxonomy_for_object_type('post_tag', 'page');
register_taxonomy_for_object_type('category', 'page');
}
add_action( 'init', 'activate_category_page' );
@tdmrhn
tdmrhn / blocksy-blog-filter.php
Last active April 29, 2023 11:26
Blocksy Blog or CPT live jQuery filter
<script>
jQuery(document).ready(function($) {
$('.ct-filter').on( 'click', function(event){
var $type = $(this).data("filter");
if($type == "all"){
$('.entry-card').fadeOut(0);
$('.entry-card').fadeIn(500);
} else {
$('.entry-card').hide();
// For CPTs just change the category class to your CPTs slug for example: '.projects-'
@tdmrhn
tdmrhn / blocksy-product-filter.php
Created May 25, 2021 23:52
Blocksy Products live jQuery filter
<script>
jQuery(document).ready(function($) {
$('.ct-filter').on( 'click', function(event){
var $type = $(this).data("filter");
if($type == "all"){
$('.type-product').fadeOut(0);
$('.type-product').fadeIn(500);
} else {
$('.type-product').hide();
// For CPTs just change the category class to your CPTs slug for example: '.projects-'
@tdmrhn
tdmrhn / blocksy-posts-open-new-tab.js
Created June 1, 2021 17:59
Blocksy Post Force Open New Tab
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery("a.ct-image-container").attr("target", "_blank");
jQuery("h2.entry-title a").attr("target", "_blank");
});
</script>
@tdmrhn
tdmrhn / blocksy-single-post-forced-layout.css
Last active June 11, 2021 10:41
Blocksy Single Post Forced Layout
[data-prefix="single_blog_post"] article { position:relative; }
[data-prefix="single_blog_post"] .entry-header ul.entry-meta , [data-prefix="single_blog_post"] .ct-featured-image {
position:absolute;
z-index:1;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto; }
@tdmrhn
tdmrhn / blocksy-mobile-menu-bordered.css
Created June 11, 2021 11:11
Blocksy Mobile Menu Bordered Style
.mobile-menu .child-indicator { background: var(--paletteColor3); color: var(--paletteColor8); padding: 3px; border-radius: 3px; }
.mobile-menu .current-menu-active .child-indicator { background: var(--paletteColor1); }
.mobile-menu .child-indicator svg { max-width: 9px; max-height: 9px; }