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
@quangmai911
quangmai911 / sendy-server
Created April 20, 2020 06:24 — forked from refringe/sendy-server
Nginx configuration file example for Sendy (http://sendy.co/).
server {
listen 80;
listen [::]:80;
server_name domain.com;
autoindex off;
index index.php index.html;
root /srv/www/domain.com/public;
@quangmai911
quangmai911 / settings.php
Last active June 1, 2020 23:41 — forked from parthtechcompose/settings.php
Add Advanced Custom Fields (ACF) to a frontend form
<?php
$settings=array(
/* (string) Unique identifier for the form. Defaults to 'acf-form' */
'id'=>'acf-form',
/* (int|string) The post ID to load data from and save data to. Defaults to the current post ID.
Can also be set to 'new_post' to create a new post on submit */
'post_id'=>false,
@quangmai911
quangmai911 / acfcdt-relevanssi-support.php
Created June 4, 2020 01:52 — forked from mishterk/acfcdt-relevanssi-support.php
How to add custom table data to Relevanssi's search index
<?php
add_filter( 'relevanssi_content_to_index', 'acfcdt_relevanssi_support', 10, 2 );
add_filter( 'relevanssi_excerpt_content', 'acfcdt_relevanssi_support', 10, 2 );
function acfcdt_relevanssi_support( $content, $post ) {
/**
* Approach A (recommended): Using SQL to minimise database queries during Relevanssi's indexing process.
*/
global $wpdb;
@quangmai911
quangmai911 / gist:28a160ba7eaeb2d9c40e749f45cf67d1
Created June 5, 2020 11:22 — forked from oooh-boi/gist:80e78f98fb1c0cd48c56a0a414d934b3
Show hide Header on scroll - OoohBoi video tutorial
<script>
"use strict";
OB_ready(OB_doWhenReady);
function OB_doWhenReady() {
// localize everything
var ooohBoi = window.ooohBoi || {};
// local scope variables
ooohBoi.prev_scroll_pos = window.scrollY || document.body.scrollTop;
ooohBoi.cur_scroll_pos;
@quangmai911
quangmai911 / ff-order-form.css
Created June 8, 2020 22:18 — forked from cpaul007/ff-order-form.css
CSS Snippet for Order Form
.fluent_form_18 .ff-el-form-check-label {
display: none;
}
.fluent_form_18 .ff-el-image-holder {
border: 2px solid #f8f8f8;
padding: 5px 5px 0;
}
.fluent_form_18 .ff-el-image-holder.ff_item_selected {
@quangmai911
quangmai911 / gist:b9369f3250b261b48092bc2acf192a6c
Created June 8, 2020 22:20 — forked from oooh-boi/gist:5d1f00ee8362292dba0af27700b05d74
OoohBoi Video Tutorial : Super-flexible Sections and Columns in Elementor PRO
/* MAGICAL CSS Rule */
selector .elementor-container .elementor-row {
flex-wrap: wrap;
/* uncomment for columns alignment */
/* justify-content: center; */
}
/* Responsive Columns Alignment - Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
selector .elementor-container .elementor-row {
/*
By oooh boi - Elementor Tips and Tricks
This will create "triangles" custom shape divider on the
right-hand side of the column (vertical), and then crete
another one (horizontal) for mobile devices.
*/
@media (min-width: 768px) {
selector:before {
content: "";
position: absolute;
@quangmai911
quangmai911 / YWP_widget.php
Created February 19, 2021 05:37 — forked from joshp23/YWP_widget.php
WordPress widget to fetch and display YOURLS shorturl
<?php
/*
Name: YOURLS WordPress Widget
Description: A WordPress widget to display a YOURLS shorturl and QR code
Code URI: https://gist.github.com/joshp23/3f990e6ec36e24ba53985968bbfa89f1
Author: Josh Panter
Author URI: https://unfettered.net
======================================================================
This widget will create &/or fetch the existing short URL for a WordPress post from YOURLS,
provide a button to copy the short url, and optionally display a qrcode.
@quangmai911
quangmai911 / protect_login_for_admin_roles.php
Last active March 30, 2021 09:40 — forked from techjewel/protect_login_for_admin_roles.php
Code snippet to reject login for admin/authors from the regular login url
<?php
/*
* Code snippet to reject login for admin/authors from the regular login url
* In this example, people who have edit_posts permission is require special url string to login
* The URL need to be: https://yourdomain.com/wp-login.php?salt=your_random_url_string
* For normal users they can login without the special salt
* But If author or admin try to login it will reject the authentication
*
@quangmai911
quangmai911 / cpt-archive-card-1.css
Created April 24, 2021 12:41 — forked from tdmrhn/cpt-archive-card-1.css
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;}