Skip to content

Instantly share code, notes, and snippets.

@calliaweb
calliaweb / add-pages-to-soliloquy-featured-content-slider.php
Last active August 29, 2015 13:56
Add static pages to Soliloquy featured content slider. See http://calliaweb.co.uk/soliloquy-featured-content-slider/ for more details.
@calliaweb
calliaweb / add-date-title-to-genesis-date-archives.php
Last active August 29, 2015 14:00
Add date title to genesis date archives
<?php
// Do NOT include the opening php tag above
add_action( 'genesis_before_loop','jmw_add_archive_date_title', 15 );
/**
* Add date headline to date archive pages.
*
* If we're not on a date archive page then nothing extra is displayed.
*
* The date is marked up as a level 1 heading.
<?php
/**
* Plugin Name: Remove H1 Format
* Plugin URI: http://calliaweb.co.uk/modify-tinymce-editor/
* Description: A simple plugin to remove the H1 format from the WordPress TinyMCE editor.
* Version: 1.0.0
* Author: Jo Waltham
* Author URI: http://calliaweb.co.uk/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
<?php
// Do NOT include the opening php tag above
/**
* Helper function to determine if we're on a blog section of a Genesis site.
*
* @since 2.0.0
*
* @param $archives_only set to false to return true on singular posts
* @return bool True if we're on any section of the blog.
.archive .one-third .entry-title,
.archive .one-fourth .entry-title,
.archive .one-sixth .entry-title,
.search .one-third .entry-title,
.search .one-fourth .entry-title,
.search .one-sixth .entry-title {
font-size: 18px;
text-align: center;
}
@calliaweb
calliaweb / show-sub-categories.php
Created October 7, 2014 18:14
Show sub categories
<?php
// If sub categories don't show products only show sub categories.
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'jmw_sub_categories_loop' );
function jmw_sub_categories_loop() {
// Are there sub categories?
$term_object = get_queried_object();
@calliaweb
calliaweb / jmw-sort-users.php
Last active August 29, 2015 14:13
Sort users by last name and then first name
<?php
function nm2_people_page() {
// Get all user IDs
$args = array(
'fields' => 'ID',
);
$pids = get_users( $args );
@calliaweb
calliaweb / add-title-above-posts-only-if-there-are-posts.php
Last active August 29, 2015 14:13
Add title above posts only if there are posts
<?php
//* Do NOT include the opening php tag
add_action( 'genesis_before_while', 'custom_add_title_before_loop' );
/*
* Echo out the title
* The genesis_before_while runs after the if( have_posts() )
* and before while( have_posts() ) : the_post();
*/
function custom_add_title_before_loop() {
<?php
/**
* Display alphabetical list of tags.
* Template Name: Tag Index
* @author Joanne Waltham
*/
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'jmw_do_tag_index_loop' );
@calliaweb
calliaweb / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console