Skip to content

Instantly share code, notes, and snippets.

View Urano-Gonzalez's full-sized avatar
🏠
Working from home

Urano Gonzalez Urano-Gonzalez

🏠
Working from home
View GitHub Profile
@rickalday
rickalday / WooCommerce Category and Product listing
Last active June 21, 2019 22:44
WooCommerce Category and Product listing
$args = array(
'number' => $number,
'orderby' => 'title',
'order' => 'ASC',
'hide_empty' => $hide_empty,
'include' => $ids
);
$product_categories = get_terms( 'product_cat', $args );
$count = count($product_categories);
if ( $count > 0 ){
@nonsintetic
nonsintetic / readme.md
Last active January 19, 2024 10:57
PHP - Get YouTube subscriber count with Youtube API v3

How to:

Here's a 'simple' way to get the YouTube subscriber number from Google's Youtube API v3:

  1. Go to https://console.developers.google.com/apis/library
  2. Log in with your Google account.
  3. Next to the logo click on 'Project' and 'Create project'. Name it whatever you want and click on 'Create'.
  4. Wait until the project is created, the page will switch to it by itself, it will take a couple of seconds up to a minute. Once it's done it will be selected next to the logo.
  5. Once it's created and selected, click on 'Credentials' from the menu on the left.
  6. Click on 'Create Credentials' and choose 'API Key'. You can restrict it to specific IPs, or types of requests (website, android, ios etc.) if you want, it's safer that way.
@corsonr
corsonr / gist:8703820
Last active December 23, 2020 08:16
WooCommerce : Remove the "shop" title on the main shop page
<?php
/**
* Removes the "shop" title on the main shop page
*/
add_filter( 'woocommerce_show_page_title', '__return_false' );
@bgallagh3r
bgallagh3r / wp.sh
Last active March 24, 2024 03:12
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "