Skip to content

Instantly share code, notes, and snippets.

View jcasabona's full-sized avatar

Joe Casabona jcasabona

View GitHub Profile
@zgordon
zgordon / gutenberg-block-tempalte-example.php
Created April 13, 2018 18:04
Example of how to set default blocks for a post in Gutenberg with block templates.
<?php
function wpvipblocks_templates( $args, $post_type ) {
if ( $post_type == 'post' ) {
$args['template_lock'] = true;
$args['template'] = [
[
'core/heading', [
'placeholder' => 'Add heading here.',
@cdevroe
cdevroe / gist:1b0d52e1c5edc14f4dcc
Last active August 29, 2015 14:10
Feedly Custom Share to Unmark
Hosted Unmark
https://unmark.it/mark/add?url=${url}&title=${title}
Self-hosted Unmark
http://YOUR-URL-HERE/mark/add?url=${url}&title=${title}
@kosinix
kosinix / custom-nav-walker-usage.php
Last active November 1, 2024 03:36
WordPress: Using a custom nav walker to create navigation menus in plain <a> tags. That is the <ul> and <li> tags are not present. Very useful if you want to create simple links that can be centered with a simple text-align:center on the containing element.
<?php
// In your template files like footer.php
// The items_wrap value ('%3$s') removes the wrapping <ul>, while the custom walker (Nav_Footer_Walker) removes the <li>'s.
wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new Nav_Footer_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'footer', 'fallback_cb'=>false ));
?>
@banago
banago / fb-parse-feed-curl.php
Created October 10, 2012 10:05
Facebook Page Feed Parser through cURL or SimpleXML in PHP
</php
/**
* Facebook Page Feed Parser
*
* @using cURL
*/
function fb_parse_feed( $page_id, $no = 5 ) {
// URL to the Facebook page's RSS feed.
@JoshuaEstes
JoshuaEstes / 000-Cheat-Sheets.md
Last active May 1, 2024 04:03
Developer Cheat Sheets for bash, git, gpg, irssi, mutt, tmux, and vim. See my dotfiles repository for extra info.