Skip to content

Instantly share code, notes, and snippets.

@tdmrhn
tdmrhn / ESP8266 Mqtt Pin Control
Last active April 29, 2016 07:00
mqtt, esp8266, pin control
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
#define MQTT_SERVER "192.168.1.2" // change the mqttbroker address
const char* ssid = "xxxxx"; // your wi-fi name
const char* password = "xxxxx"; // your wi-fi password
const int pin = 0; // in basic esp-01 you can control pin-0 and pin-2
char* clientname = "newesp"; // the mqtt client adress must be unique more than one esp usage
char* sublight = "/test/light"; // the mqtt sub adress
char* publight = "/test/light/confirm"; // the mqtt pub adress
@tdmrhn
tdmrhn / blog-archive-card.css
Last active April 11, 2021 09:15
Blog archive card design
[data-prefix="blog"] [data-cards="simple"] .entry-card {position:relative;min-height:700px;}
[data-prefix="blog"] [data-cards="simple"] .entry-excerpt {background:#fff;padding:80px 30px; margin:0 10px; border-radius:15px;position:absolute;bottom:0;border:1px solid #eee;min-height:430px;}
[data-prefix="blog"] [data-cards="simple"] .entry-title {position:absolute;top:300px;z-index:1;padding:0 40px;}
[data-prefix="blog"] [data-cards="simple"] .ct-button {position:absolute;bottom:30px;margin:0 40px;}
@tdmrhn
tdmrhn / cpt-archive-card-1.css
Last active April 26, 2021 17:24
Custom Post Archive Card Design
[data-prefix="projeler_archive"] [data-cards="simple"] .entry-card {position:relative; padding:0; overflow:hidden; border-radius:20px;}
[data-prefix="projeler_archive"] [data-cards="simple"] .entry-card .ct-image-container{margin:0;}
[data-prefix="projeler_archive"] [data-cards="simple"] .entry-excerpt {position:absolute; width:100%; height:100%; padding:60px 30px; top:0; left:100%; transition:.5s; color:var(--paletteColor5); background:var(--paletteColor3);}
[data-prefix="projeler_archive"] [data-cards="simple"] .entry-card:hover .entry-excerpt {top:0; left:0%;}
[data-prefix="projeler_archive"] [data-cards="simple"] .entry-title {position:absolute; bottom:0; padding:30px; margin:0; width:100%; background:linear-gradient(0deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);color:var(--paletteColor5);z-index:1;}
@tdmrhn
tdmrhn / blog-archive-card-2.css
Last active May 9, 2021 14:25
Blog Archive Card Design #3
[data-prefix="blog"] [data-cards="boxed"] .entry-card {position:relative;}
[data-prefix="blog"] [data-cards="boxed"] .entry-meta {margin-bottom:0;}
[data-prefix="blog"] [data-cards="boxed"] .entry-meta li.meta-categories {position:absolute; right:10px; margin-top:-40px;}
[data-prefix="blog"] [data-cards="boxed"] .entry-meta li.meta-categories a {background:var(--paletteColor1); color:var(--paletteColor8); font-size:11px; padding:.5em 1em; border-radius:5px;}
[data-prefix="blog"] [data-cards="boxed"] .entry-meta li.meta-categories a:hover {background:var(--paletteColor2);}
@tdmrhn
tdmrhn / subscribe-form-design.css
Created May 11, 2021 15:10
Copy CT Subscribe Form Design
.ct-mailchimp-block form section { position: relative; }
.ct-mailchimp-block form input { width: 550px; height: 55px; padding: 0 150px 0 35px; border:2px solid var(--paletteColor5); border-radius: 4px; }
.ct-mailchimp-block form button { position: absolute; padding: 0 15px; width: 135px; top: 8px; right: 8px; border-radius: 4px; }
@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 / 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-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-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; }