Skip to content

Instantly share code, notes, and snippets.

View litonarefin's full-sized avatar
🎯
Focusing

Liton Arefin litonarefin

🎯
Focusing
View GitHub Profile
@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 / 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
====================================*/
<?php
//=============================================================================================
// FUNCTION -> MINIFY HTML OUTPUT
//=============================================================================================
class WP_HTML_Compression {
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
/*
* 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 */
}
@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' ),
.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 / ecp-widget.php
Created September 11, 2019 13:40 — forked from spigotdesign/ecp-widget.php
Events Calendar Pro event
<?php $efeed = new WP_Query( array(
'post_type' => 'tribe_events',
'showposts' => 2,
'eventDisplay' => 'upcoming',
'start_date' => $current_date,
'end_date' => $current_date,
'orderby' => 'start_date',
'order' => 'ASC',
'tax_query' => array(
array(
'eicon-editor-link' => 'eicon-editor-link',
'eicon-editor-unlink' => 'eicon-editor-unlink',
'eicon-editor-external-link' => 'eicon-editor-external-link',
'eicon-editor-close' => 'eicon-editor-close',
'eicon-editor-list-ol' => 'eicon-editor-list-ol',
'eicon-editor-list-ul' => 'eicon-editor-list-ul',
'eicon-editor-bold' => 'eicon-editor-bold',
'eicon-editor-italic' => 'eicon-editor-italic',
'eicon-editor-underline' => 'eicon-editor-underline',
'eicon-editor-paragraph' => 'eicon-editor-paragraph',
@litonarefin
litonarefin / breadcrumbs-functions.php
Created March 5, 2019 10:42 — forked from tinotriste/breadcrumbs-functions.php
Wordpress: Breadcrumbs function
<?php
/*=============================================
= BREADCRUMBS =
=============================================*/
// to include in functions.php
function the_breadcrumb() {
$sep = ' > ';
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2019.03.03
* license: MIT
*/
function dimox_breadcrumbs() {
/* === OPTIONS === */