Skip to content

Instantly share code, notes, and snippets.

View giorgioriccardi's full-sized avatar
🎯
Focusing

Giorgio Riccardi giorgioriccardi

🎯
Focusing
  • Giorgio Riccardi Creations
  • Vancovuer, BC, Canada
View GitHub Profile
/*
If you want more control over impress.js, the first thing is to change the way you call it. The demo
initializes impress.js like this:
<script src="js/impress.js"></script>
<script>impress().init();</script>
You want to change this to the following:
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
$args = array(
'tag' => 'featured',
'category__in' => array( 43, 52 ),
'author__in' => array( 255, 930 )
);
$author_featured_posts = new WP_Query( $args );
@giorgioriccardi
giorgioriccardi / if_else_lang.php
Last active May 15, 2018 20:59 — forked from beovulf/if_else_lang.php
If else language wordpress (polylang)
<?php
$currentlang = get_bloginfo('language');
if($currentlang=="en-CA"):
?>
<?php elseif($currentlang=="fr-CA"): ?>
<?php endif; ?>
or to avoid limitations or issues with "en-CA" "en-GB" "en-US" "en-UK" "fr-FR" etc:
@giorgioriccardi
giorgioriccardi / webdev_online_resources.md
Created August 24, 2018 00:09 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@giorgioriccardi
giorgioriccardi / docker_wordpress.md
Created January 24, 2019 16:40 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@giorgioriccardi
giorgioriccardi / Update cached .gitignore
Last active August 12, 2019 22:40 — forked from c33k/Update .gitignore
Updating .gitignore and cleaning the cache
// First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
// This removes any changed files from the index(staging area), then just run:
git add .
// Commit
git commit -m "Remove .gitignore cached files"
@giorgioriccardi
giorgioriccardi / wl-api.php
Last active August 26, 2019 18:54 — forked from ivandoric/wl-api.php
Creating WordPress Rest API Custom Endpoints
<?php
/**
* Plugin Name: Custom API
* Plugin URI: http://chrushingit.com
* Description: Crushing it!
* Version: 1.0
* Author: Art Vandelay
* Author URI: http://watch-learn.com
* YouTube URI: https://www.youtube.com/watch?v=C2twS9ArdCI
*/
@giorgioriccardi
giorgioriccardi / wp-content-task-runner.php
Last active September 21, 2019 07:41
WP scraper/importer via API call, a rough proof of concept. Do NOT use into production or live environments!
<?php
// allow direct access to the file via front-end
// http://twentyninteen.local/wp-content/themes/twentynineteen/wp-content-task-runner.php
$path = preg_replace('/wp-content.*$/', '', __DIR__);
require_once $path . 'wp-load.php';
// test that we get some content
// var_dump(get_post(1));
// A collection of all APIs available:
@giorgioriccardi
giorgioriccardi / vscode_shortcuts.md
Created January 3, 2020 16:33 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands