Skip to content

Instantly share code, notes, and snippets.

View incidunt's full-sized avatar

incidunt incidunt

View GitHub Profile
@defunkt
defunkt / clients.md
Created April 18, 2010 14:09
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@jeremyfelt
jeremyfelt / gist:2625350
Created May 7, 2012 01:37
Post type argument test results
'rewrite' => true
'public' => true 'publicly_queryable' => true /cpt-slug/cpt-post-slug Loads fine
'public' => false 'publicly_queryable' => true /cpt-slug/cpt-post-slug Loads fine
'public' => true 'publicly_queryable' => false /cpt-slug/cpt-post-slug 404 Error
'public' => false 'publicly_queryable' => true /cpt-slug-cpt-post-slug 404 Error
'rewrite' => false
'public' => true 'publicly_queryable' => true /?cpt-slug=cpt-post-slug Loads fine
'public' => true 'publicly_queryable' => true /?p=ID&post_type=cpt-slug Loads fine
'public' => false 'publicly_queryable' => true /?cpt-slug=cpt-post-slug Loads fine
@willurd
willurd / web-servers.md
Last active May 30, 2024 02:54
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@strangerstudios
strangerstudios / heartbeat-api-demo.php
Last active April 30, 2024 17:08
Minimal example demonstrating the WordPress Heartbeat API being added in WP version 3.6.
<?php
/*
Plugin Name: Heartbeat API Demo
Plugin URI: http://www.strangerstudios.com/wp/heartbeat-api-demo
Description: Minimal example demonstrating the WordPress Heartbeat API being added in WP version 3.6.
Version: .1
Author: strangerstudios
If logged in as a user and viewing the frontend of your website,
every 15 seconds you should see the following in your Javascript console:
@justintadlock
justintadlock / register-post-type.php
Last active October 22, 2023 05:55
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@srikat
srikat / functions.php
Last active December 16, 2020 01:48
Moving Post Title and Post Info from Entry Header to Entry Content in Genesis. http://sridharkatakam.com/move-post-title-post-info-entry-header-entry-content-genesis/
//* Move Post Title and Post Info from inside Entry Header to Entry Content on Posts page
add_action( 'genesis_before_entry', 'reposition_entry_header' );
function reposition_entry_header() {
if ( is_home() ) {
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
@About2git
About2git / archive-books.php
Last active November 17, 2020 18:12 — forked from srikat/archive-books.php
Single and Archive templates for Custom Post Type in Genesis
<?php
//* Remove breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
//* Force full width content
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Remove entry meta in entry header
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
@andreineculau
andreineculau / sendmail.app
Last active February 2, 2018 16:41 — forked from masnick/gist:6985205
a nice way to send mail from the shell in osx
#!/usr/bin/env osascript
# usage: sendmail.app from@me.com to@you.com,and@you.com "have you seen this?" "a nice way to send mail/attachment from the shell in osx (if you have configured Mail.app) https://gist.github.com/andreineculau/38f6160cc9aa11956953"
on theSplit(theString, theDelimiter)
-- save delimiters to restore old settings
set oldDelimiters to AppleScript's text item delimiters
-- set delimiters to delimiter to be used
set AppleScript's text item delimiters to theDelimiter
-- create the array
@patric-boehner
patric-boehner / ReadMe.md
Last active March 6, 2020 04:43
Single Post Navigation (Pagination)

#Customize and display links to previous and next post, from a single post


This snippet is for displaying and customizing the links to previous and next posts, for single post entries within the Genesis Framework.

Normally the links to the previous and next post are displayed in the entry footer as the title of the next and previous posts. I wanted to customize the function to swap the link order so that the newest article was accessible from the link on the left and the previous article was accessible form the link on the right, to better navigate posts in an ascending order. I also wanted to add the text "Previous Post" and "next Post" above the linked post titles for better clarification. See the comment in the code for more detail.

For additional customizable permeates, see the codex links under References.