Skip to content

Instantly share code, notes, and snippets.

Avatar
🤘
Rocking this project.

Mike Garrett MikeNGarrett

🤘
Rocking this project.
View GitHub Profile
@jawinn
jawinn / primary_category.php
Last active Nov 21, 2020
Display Primary Category (Yoast's WordPress SEO)
View primary_category.php
<?php
// SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY
$category = get_the_category();
$useCatLink = true;
// If post has a category assigned.
if ($category){
$category_display = '';
$category_link = '';
if ( class_exists('WPSEO_Primary_Term') )
@stevegrunwell
stevegrunwell / gist:11c3e9d370127fa97898
Last active Oct 20, 2020
Bulk-upgrade WordPress plugins using WP-CLI, committing each upgrade to Git as we go
View gist:11c3e9d370127fa97898
#! /bin/bash
# Find available updates for WordPress plugins via WP-CLI, then upgrade theme one at a time.
# After each upgrade, commit the changed files to Git.
#
# Requires that WP-CLI be installed and in your path: http://wp-cli.org/
#
# Currently, it will only work when run from the root of the WordPress installation, and has
# a hard-coded path for wp-content/plugins.
#
View add_fields_to_bundle_programatically.php
<?php
/**
* This file will demonstrate a method to export fields to code.
* You can use this to easily create fields using the UI, export to code
* and then use in a custom module. Upon installation of the module
* your fields and instances will already be set up.
*/
// Create the fields you want using the Drupal UI.
// On the same site, go to example.com/devel/php
@claudiosanches
claudiosanches / node.tpl.php
Created Oct 4, 2012
Drupal - Get node permalink
View node.tpl.php
<?php print get_node_permalink($node); ?>
@level09
level09 / rebuild_permissions
Created Jul 21, 2012
Drush: rebuild permissions table using command line in Drupal
View rebuild_permissions
drush php-eval 'node_access_rebuild();'
@louisremi
louisremi / LICENSE.txt
Created Oct 30, 2011 — forked from 140bytes/LICENSE.txt
popstate, polyfill that executes window.onpopstate callback whenever location.hash changes
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 @louis_remi <http://louisremi.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
You can’t perform that action at this time.