Skip to content

Instantly share code, notes, and snippets.

View litonarefin's full-sized avatar
🎯
Focusing

Liton Arefin litonarefin

🎯
Focusing
View GitHub Profile
.flood .service:nth-of-type(1) {
#redSwatch {
@include animation-name(red-swatch-go);
@extend .animation-settings;
@include transform-origin(32%, 78%);
}
&:hover #redSwatch {
@include animation-name(red-swatch-off);
@litonarefin
litonarefin / gist:f8c0dc9f480d2cab2a76279103a268b7
Created December 31, 2019 09:44
Add External Image option for Backgrounds
extend the Group Control Base in my plugin to create an external background image option field to go with the standard classic background options.
class Group_Control_Background_trchristensen extends Group_Control_Background {
public function init_fields() {
$fields = parent::init_fields();
//here you add your field
$fields['ext_image'] = [
'label' => _x( 'External Image', 'Background Control', 'elementor' ),
'type' => Controls_Manager::TEXT,
'title' => _x( 'Background Image', 'Background Control', 'elementor' ),
/*
* Reference: https://responsivedesign.is/develop/browser-feature-support/media-queries-for-common-device-breakpoints/
* https://css-tricks.com/snippets/css/media-queries-for-standard-devices/
*/
/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
/* Styles */
}
<?php
//=============================================================================================
// FUNCTION -> MINIFY HTML OUTPUT
//=============================================================================================
class WP_HTML_Compression {
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
@litonarefin
litonarefin / elementor-condition-example.php
Created February 17, 2020 06:41 — forked from Sharifur/elementor-condition-example.php
elementor condition example, elementor multiple condition example
<?php
class Elementor_Custom_Widget extends \Elementor\Widget_Base {
/*=================================
Single condition:-
====================================*/
/*=================================
Credit: Eqbal Rony
original gist: https://github.com/iqbalrony/elementor-conditions/blob/master/conditions.php
====================================*/
@litonarefin
litonarefin / CreateWordpressUser.php
Created March 11, 2020 10:04 — forked from jawinn/CreateWordpressUser.php
Create WordPress Admin User from PHP
<?php
// ADD NEW ADMIN USER TO WORDPRESS
// ----------------------------------
// Put this file in your Wordpress root directory and run it from your browser.
// Delete it when you're done.
require_once('wp-blog-header.php');
require_once('wp-includes/registration.php');
// ----------------------------------------------------
@litonarefin
litonarefin / .htaccess
Created May 29, 2020 12:02 — forked from ankurk91/.htaccess
Some .htaccess tips and tricks
# Source internet
# Use at your own risk, test on localhost first
# Ovrride Default index.php
DirectoryIndex home.php
# Prevent access to some files
<FilesMatch "^(wp-config.php|readme.html|license.txt|README.md|.gitignore|.gitattributes|.htaccess|error_log)">
Order allow,deny
Deny from all
<?php
class Capture
{
/**
* Capture web screenshot using google api.
*
* @param (string) $url Valid url
*
* @return blob
@litonarefin
litonarefin / clean_wordpress_head.php
Created March 31, 2021 15:20 — forked from robwent/clean_wordpress_head.php
A collection of snippets for a Wordpress theme's function.php file to clean up the output
<?php
/**
* Core output
**/
//Remove the generator tag
remove_action('wp_head', 'wp_generator');
//Remove the frontend admin bar while in development
<?php
if (!class_exists('CSF_Callback_Testing')) {
class CSF_Callback_Testing
{
public $prefix = '_testing_callback';
public $options;