Skip to content

Instantly share code, notes, and snippets.

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

Salman Ahmed salmancreation

🏠
Working from home
View GitHub Profile
@cdils
cdils / editor-style.php
Last active March 27, 2020 05:49
Apply theme's stylesheet to the visual editor.
add_action( 'init', 'cd_add_editor_styles' );
/**
* Apply theme's stylesheet to the visual editor.
*
* @uses add_editor_style() Links a stylesheet to visual editor
* @uses get_stylesheet_uri() Returns URI of theme stylesheet
*/
function cd_add_editor_styles() {
add_editor_style( get_stylesheet_uri() );
* Downloaded or downloading
=============================
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html
@BFTrick
BFTrick / woocommerce-settings-tab-demo.php
Last active March 26, 2024 10:48
A plugin demonstrating how to add a WooCommerce settings tab.
<?php
/**
* Plugin Name: WooCommerce Settings Tab Demo
* Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a
* Description: A plugin demonstrating how to add a WooCommerce settings tab.
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@magicznyleszek
magicznyleszek / css-selectors.md
Last active March 29, 2024 01:12
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {
@drabbytux
drabbytux / Magnific Popup CSS
Last active June 2, 2022 22:36
MFP (Magnific Popup) CSS extras
/*================ Vendor-specific styles ================*/
/* Magnific Popup CSS */
.mfp-bg {
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1042;
overflow: hidden;
position: fixed;
@TANVIRFAZLEY
TANVIRFAZLEY / tab.php
Created December 16, 2016 18:22
Tab dynamic in wordpress
/*DEMO*/
<div id="tab">
<ul class="nav nav-tabs" role="tablist">
<?php $loop = new WP_Query( array( 'post_type' => 'candidates', 'posts_per_page' => -1 ) ); ?>
<?php
$counter = 0;
while ( $loop->have_posts() ) : $loop->the_post();
$counter++;
<?php
if(!function_exists('wc_get_products')) {
return;
}
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
$ordering = WC()->query->get_catalog_ordering_args();
$ordering['orderby'] = array_shift(explode(' ', $ordering['orderby']));
$ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby'];
@kamalahmed
kamalahmed / set-default-fonts-in-elementor-from-theme-or-plugin.php
Last active February 6, 2024 14:54
Update or Set new default fonts in Elementor from your plugin or theme
<?php
add_action('elementor/loaded', 'prefix_register_custom_default_fonts');
// register custom fonts only when elementor is ready
function prefix_register_custom_default_fonts(){
$new_default_fonts = [
//Primary Headline
[
@kamalahmed
kamalahmed / fix-svg-upload-error-in-wordpress.php
Last active October 3, 2023 13:16
Fix the “Sorry, this file type is not permitted for security reasons.” issue on WordPress while uploading an SVG file
<?php
/**
* A workaround for upload validation which relies on a PHP extension (fileinfo) with inconsistent reporting behaviour.
* ref: https://core.trac.wordpress.org/ticket/39550
* ref: https://core.trac.wordpress.org/ticket/40175
*/
function prefix_filter_fix_wp_check_filetype_and_ext( $data, $file, $filename, $mimes ) {
if ( ! empty( $data['ext'] ) && ! empty( $data['type'] ) ) {
return $data;
}
@giansalex
giansalex / .bashrc
Last active May 26, 2020 23:01
Git Commands Alias
alias gs='git status'
alias ga='git add'
alias gl='git pull'
alias gp='git push'
alias gc='git clone'
alias gck='git checkout'
alias ga='git add'
alias grh='git reset HEAD~1'
alias gm='git merge'
alias gcm='git commit -m '