Skip to content

Instantly share code, notes, and snippets.

@alexgraham
alexgraham / app.js
Created September 6, 2015 16:59
JQueryUI Selectmenu z-index changing
$(this).selectmenu({
open: function() {
$( $( $(this).selectmenu( "widget" )[1] )[0] ).css('z-index', 11);
}
});
@alexgraham
alexgraham / comments.php
Created January 20, 2015 19:13
WordPress Comment form customisation (inc HTML5 validation and accessibility improvements)
<?php
/*
* If the current post is protected by a password and the visitor has not yet
* entered the password we will return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
?>
@alexgraham
alexgraham / acf-theme-options.php
Created January 12, 2015 15:46
Advanced Custom Fields - Theme options register and sub-pages
/*
* Register Theme Option pages
*/
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Theme Options',
'menu_title' => 'Theme Options',
'menu_slug' => 'theme-options',
'capability' => 'edit_posts',
'redirect' => false
@alexgraham
alexgraham / gist:e775a8989985806e9672
Last active August 29, 2015 14:10
WordPress custom post type WP_Query on front_page.php with working pagination
<?php $paged = ( get_query_var('page') ) ? get_query_var('page') : 1; ?>
<?php $gallery_args = array(
'paged' => $paged,
'post_type' => 'gallery',
'posts_per_page' => 1
); ?>
<?php $gallery_query = new WP_Query( $gallery_args ); ?>
<?php // Pagination fix