Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@calliaweb
calliaweb / Add Custom Taxonomies to Post Meta
Created November 27, 2013 14:25
Modify Post Meta to add custom taxonomies Author Jo Waltham jo@calliaweb.co.uk Add function to your functions.php
/** Modify Post Meta to add custom taxs
* Author Jo Waltham jo@calliaweb.co.uk
* Add function to your functions.php
*/
add_filter( 'genesis_post_meta', 'jmw_post_meta_filter' );
function jmw_post_meta_filter($post_meta) {
if ( !is_single() ) // Only runs on single posts - remove if you want the output on archive pages
return;
@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.
@calliaweb
calliaweb / modify-tinymce-editor-to-remove-h1.php
Last active August 3, 2023 16:00
Modify TinyMCE editor to remove H1
<?php
// Do NOT include the opening php tag above
add_filter('tiny_mce_before_init', 'tiny_mce_remove_unused_formats' );
/*
* Modify TinyMCE editor to remove H1.
*/
function tiny_mce_remove_unused_formats($init) {
// Add block format elements you want to show in dropdown
$init['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Address=address;Pre=pre';
<?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 / display-advanced-custom-fields-gallery-as-an-envira-gallery.php
Last active November 11, 2020 18:44
Display Advanced Custom Fields Gallery as an Envira Gallery
@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 / filter-genesis-structural-wrap.php
Last active September 15, 2016 05:51
Filter Genesis Structural Wrap
<?php
//* Do NOT include the opening php tag
add_filter( "genesis_structural_wrap-footer-widgets", 'jmw_filter_footer_widgets_structural_wrap', 10, 2);
/**
* Filter the footer-widgets context of the genesis_structural_wrap to add a div before the closing wrap div.
*
* @param string $output The markup to be returned
* @param string $original_output Set to either 'open' or 'close'
*/