Skip to content

Instantly share code, notes, and snippets.

View wowthemesnet's full-sized avatar

WowThemes.net wowthemesnet

View GitHub Profile
@wowthemesnet
wowthemesnet / terminal
Created October 26, 2020 19:30
steps to first publish repo
git init
git add .
git commit -m "first"
git remote add origin "xxxxxxxxxxx.git"
git push --set-upstream origin master
@wowthemesnet
wowthemesnet / functions.php
Created June 1, 2020 16:45
Get Media Embedded in Content WordPress
<?php $audio_media = get_media_embedded_in_content(
apply_filters( 'the_content', get_the_content() ), array( 'audio')
);
if ( has_post_format( 'audio' )) {
foreach ($audio_media as $audio_med) {
echo $audio_med;
}
}
?>
@wowthemesnet
wowthemesnet / functions.php
Created May 4, 2020 11:56
Getting download link from EDD store using URL variable
<?php
function add_query_vars_filter( $vars ){
$vars[] = "item";
return $vars;
}
add_filter( 'query_vars', 'add_query_vars_filter' );
get_query_var('item');
@wowthemesnet
wowthemesnet / gulpfile.js
Last active March 9, 2020 00:16
Gulp-zip for Gulp4
function deploy() {
return src([
'./**/*',
'!bower_components',
'!./{node_modules,node_modules/**/*}',
'!./package-lock.json',
'!./debug.log',
'!./gitignore',
'!./assets/{sass,sass/*}'
], {base: "."})
@wowthemesnet
wowthemesnet / random-image.js
Last active March 8, 2020 14:32
Add random images for multiple img on the same page instead of boring placeholders
var description = [
"https://images.unsplash.com/photo-1561508539-d46a8ac4b20a?ixlib=rb-1.2.1&auto=format&fit=crop&w=675&q=80",
"https://images.unsplash.com/photo-1507914464562-6ff4ac29692f?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80",
"https://images.unsplash.com/photo-1565291967637-238f8c5da3de?ixlib=rb-1.2.1&auto=format&fit=crop&w=668&q=80",
"https://images.unsplash.com/photo-1583485267393-510232b60ef7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1341&q=80",
"https://images.unsplash.com/photo-1583356016434-ce82434ed5a1?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80",
"https://images.unsplash.com/photo-1510191240544-c9de9dd0baed?ixlib=rb-1.2.1&auto=format&fit=crop&w=1351&q=80",
"https://images.unsplash.com/photo-1583433348433-b23d79556ee6?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80"
];
@wowthemesnet
wowthemesnet / cmd.exe
Created May 19, 2019 17:30
Remove .git from folders
Display the hidden folders: $ ls -alh
Remove the .git folder: $ rm -R .git
@wowthemesnet
wowthemesnet / docker-compose.yml
Last active August 8, 2020 23:49
WordPress Development in Docker which actually works - outputs all WordPress (wp-content, wp-admin, wp-includes, wp-config.php etc) with debug enabled. Use it to create something nice!
version: '3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
@wowthemesnet
wowthemesnet / check_license.php
Last active March 8, 2020 14:33
Check license in Software Manager License
function check_license(){
$sml_url = 'https://domain.com/';
$slm_action = 'slm_check';
$secret_key = 'xxx';
$license_key = get_license_key();
$api_call = $sml_url . '?secret_key=' . $secret_key . '&slm_action=' . $slm_action . '&license_key=' . $license_key;
define('URL_SERVICE', $api_call);
@wowthemesnet
wowthemesnet / page-authors.hbs
Created March 20, 2019 15:12
Authors List Page for Ghost
{{!< default}}
<header class="site-header outer">
<div class="inner">
{% raw %}{{> "site-nav"}}
</div>
</header>
{{#post}}
<main id="site-main" class="site-main outer" role="main">
<div class="inner">
<header class="post-full-header">
@wowthemesnet
wowthemesnet / gist:171d1684ea4b1953ad32a9d5eb6e995e
Created December 13, 2018 12:26 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master