Skip to content

Instantly share code, notes, and snippets.

View quangmai911's full-sized avatar
🏠
Working from home

Quang Mai quangmai911

🏠
Working from home
View GitHub Profile
{"id":"clf8egk5b0011mq08rzq4l11j","version":"3","createdAt":"2023-03-14T15:19:57.696Z","updatedAt":"2023-03-14T18:05:40.043Z","icon":"🧳","name":"Travel Personality Quiz","folderId":null,"groups":[{"id":"gdf4lf6iq1o0rurhh06b03cw","title":"Start","blocks":[{"id":"wotftm0c5h41ojhhtx39sfe6","type":"start","label":"Start","groupId":"gdf4lf6iq1o0rurhh06b03cw","outgoingEdgeId":"o702ppi5lbsrbcl9ywxnzunb"}],"graphCoordinates":{"x":-1.513010660807292,"y":-1.3938649495442703}},{"id":"banuo15r8cqn17n9exp85g1l","title":"Question 1","blocks":[{"id":"okidfn4g35j9ayfack66st2f","type":"text","content":{"html":"<div>Find out your travel personality in just 5 questions.</div>","richText":[{"type":"p","children":[{"text":"Find out your travel personality in just 5 questions."}]}],"plainText":"Find out your travel personality in just 5 questions."},"groupId":"banuo15r8cqn17n9exp85g1l"},{"id":"qxye2idrd4xqyd07j0ijz6dp","type":"text","content":{"html":"<div>What is your dream vacation destination?</div>","richText":[{"type":"p","ch
@quangmai911
quangmai911 / PHP Mailer Configuration for WordPress.php
Created November 29, 2022 19:25 — forked from nextab/PHP Mailer Configuration for WordPress.php
Just define the globals in wp-config.php and add the code snippet in your functions.php to send e-mails via SMTP instead of the regular php mailer.
Folgenden Code unter übliche wp-config-.php-Befehle einfügen: (Auf All-Inkl angewandt - andere Host-Daten müssten dementsprechend angepasst werden...)
define( 'SMTP_USER', 'm05f2ew1' ); // Postfach-Benutzer
define( 'SMTP_PASS', 't3stpwd' ); // Postfach-Passwort
define( 'SMTP_HOST', 'w01c1234.kasserver.com' ); // Postein- und Ausgangsserver
define( 'SMTP_FROM', 'mail@example.com' ); // Gewünschte E-Mail-Adresse zum Versenden
define( 'SMTP_NAME', 'Example Website' ); // Webseiten-Name
define( 'SMTP_PORT', '465' ); // SMTP-Port - häufig 465 oder 587 (auch 25, aber unsicher)
define( 'SMTP_SECURE', 'ssl' ); // Verschlüsselungstyp (auch tls möglich)
define( 'SMTP_AUTH', true ); // SMTP-Authentifikation
@quangmai911
quangmai911 / back_to_top.php
Created October 1, 2022 09:43 — forked from thisbit/back_to_top.php
Back To Top Button
<?php
/**
* Back to Top button that appears once one scrolls past the full viewport height
* Drop this function into your functions.php, code snippets plugin ...
* You should not need to change anything, but in case your theme does not have #page id in one of top dom elements, change to the one you have
* CSS you can normally edit as you like
*/
function back_to_top() {
?>
@quangmai911
quangmai911 / blc-sticky-share-box.css
Created April 23, 2022 08:36 — forked from tdmrhn/blc-sticky-share-box.css
Blocksy Sticky Share Box
.ct-share-box[data-type="type-2"] > div { position:fixed; top:50%; background:var(--paletteColor7); border-radius:0 5px 5px 0; left:7px; max-width:80px; padding-bottom:15px; z-index:99; }
@quangmai911
quangmai911 / floating-whatsapp-button.html
Created April 23, 2022 08:35 — forked from tdmrhn/floating-whatsapp-button.html
Content Blocks Floating Whatsapp Button
<style>
.btn-whatsapp-pulse {
position: fixed;
bottom: 20px;
left: 20px;
width: 64px;
height: 64px;
border-radius: 50%;
animation-name: pulse;
animation-duration: 1.5s;
// Function to add Custom Post Type.
function olympus_custom_post_type()
{
// Register the doc post type
register_post_type( 'docs', array(
'labels' => array(
'name' => esc_html__( 'Documentation', 'olympus' ),
'singular_name' => esc_html__( 'Document', 'olympus' ),
'add_new' => esc_html__( 'Add New', 'olympus' ),
<?php
add_filter( 'woocommerce_loop_add_to_cart_link', function ( $html, $product ) {
if ( is_user_logged_in() && is_shop() && $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) {
$html = '<form action="' . esc_url( $product->add_to_cart_url() ) . '" class="cart" method="post" enctype="multipart/form-data"><div class="ct-cart-actions">';
$html .= woocommerce_quantity_input( array(), $product, false );
$html .= '<button type="submit" class="single_add_to_cart_button button alt" name="add-to-cart" value="' . $product->get_id() . '">' . esc_html( $product->add_to_cart_text() ) . '</button>';
$html .= '</div></form>';
}
return $html;
}, 10, 2 );
<?php
add_action('admin_menu', function () {
global $menu;
foreach ($menu as $index => $menuItem) {
if(!empty($menuItem[2]) && $menuItem[2] == 'ninja_tables') {
$menu[$index][0] = 'My Tables';
}
}
}, 100);
@quangmai911
quangmai911 / blocksy-blog-filter.php
Created July 5, 2021 23:05 — forked from tdmrhn/blocksy-blog-filter.php
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-'
@quangmai911
quangmai911 / blocksy-blog-filter-cs.php
Created July 5, 2021 22:53 — forked from tdmrhn/blocksy-blog-filter-cs.php
Blocksy Blog or CPT live jQuery filter CS
<?php
add_filter( 'blocksy:hero:after', 'blc_jquery_filter', 10);
function blc_jquery_filter() {
if ( is_home() ) {
?>
<script>
jQuery(document).ready(function($) {
$('.ct-filter').on( 'click', function(event){
var $type = $(this).data("filter");
if($type == "all"){