Skip to content

Instantly share code, notes, and snippets.

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

Mohammad Limon mlbd

🏠
Working from home
View GitHub Profile
/**
* First of all change prefix if you have different one. As default WordPress has `wp_`
*/
// Update home and siteurl.
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
// Update posts guid.
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
$spaceamounts: ('none', 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 75, 80, 100, 150); // Adjust this to include the pixel amounts you need.
$sides: (top, bottom, left, right); // Leave this variable alone
@each $space in $spaceamounts {
@each $side in $sides {
.m-#{str-slice($side, 0, 1)}-#{$space} {
@if $space == 'none' {
margin-#{$side}: 0px !important;
} @else {
margin-#{$side}: #{$space}px !important;
var mySwiper = new Swiper('.swiper-container', {
slidesPerView: 5,
spaceBetween: 30,
loop: true,
centeredSlides: true,
pagination: {
el: '.swiper-pagination',
clickable: true,
},
on: {
@mlbd
mlbd / Create a post with contact form 7 (wpcf7)
Created July 7, 2018 04:34
Create a post automatically with contact form 7 submission
add_action( 'wpcf7_before_send_mail', 'fordwich_create_post_after_cf7' );
/**
* Do stuff for my contact form form. This function shouldn't return aything
*
* @param WPCF7_ContactForm $contact_form wpcf7 object, passed by refference
*/
function fordwich_create_post_after_cf7( $WPCF7_ContactForm ) {
String.prototype.getValueByKey = function(k){
var p = new RegExp('\\b'+k+'\\b','gi');
return this.search(p) != -1 ? decodeURIComponent(this.substr(this.search(p)+k.length+1).substr(0,this.substr(this.search(p)+k.length+1).search(/(&|;|$)/))) : "";
};
.curex-hero-thumb {
position: absolute;
left: calc((-100vw + 100%) / 2);
right: calc((-100vw + 100%) / 2);
height: 100%;
}
/**
*
* Import Class
* A helper class for support CS to OCDI
*
*/
if ( !class_exists( 'OCDI_Plugin' ) )
return;
function eduprime_get_nested_events()
{
// get the meta
$event_posts = get_posts(array('post_type' => 'tp_event', 'posts_per_page' => -1));
if( ! $event_posts ) return '';
$status_meta = array();
foreach ($event_posts as $single ) {
$meta = get_post_meta( $single->ID, 'tp_event_status', true );
var $header_menu_link = $('.appmax-header-menu ul li a');
if ($header_menu_link.is_exist()) {
$header_menu_link.on('click', function(e){
var href = $(this).attr("href");
if (/#/.test(this.href)) {
if ( $(href).length ) {
var minus = 100;
var offsetTop = href === "#" ? 0 : $(href).offset().top - minus;
/**
* Social Share buttons
*/
if ( !class_exists( 'Pixiefy_Social_Btns' ) ) {
class Pixiefy_Social_Btns {
public $args = '';
public function __construct($args){
$this->args = $args;