This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Collapse your tables into list items on smaller devices. | |
@media only screen and (max-width: 600px) { | |
table { | |
thead {display: none;} | |
td { | |
display: list-item; | |
width: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action("gform_user_registered", "autologin", 10, 4); | |
function autologin($user_id, $config, $entry, $password) { | |
wp_set_auth_cookie($user_id, false, ''); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function lb_editor_remove_meta_box() { | |
global $post_type; | |
// Check to see if the global $post_type variable exists | |
// and then check to see if the current post_type supports | |
// excerpts. If so, remove the default excerpt meta box | |
// provided by the WordPress core. If you would like to only | |
// change the excerpt meta box for certain post types replace | |
// $post_type with the post_type identifier. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpse26032_admin_posts_filter( &$query ) | |
{ | |
if ( | |
is_admin() | |
AND 'edit.php' === $GLOBALS['pagenow'] | |
AND isset( $_GET['p_format'] ) | |
AND '-1' != $_GET['p_format'] | |
) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// USE PLACEHOLDER TEXT IN FORM FIELDS | |
var inner_form_labels = function() { | |
$('.gform_fields input').each(function() { | |
var el = $(this); | |
var placeholder = el.val(); | |
el.attr({ | |
value : null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MAKE CERTAIN COLUMNS EQUAL HEIGHTS | |
// source: http://codepen.io/micahgodbolt/pen/FgqLc | |
equalheight = function(container){ | |
var currentTallest = 0, | |
currentRowStart = 0, | |
rowDivs = new Array(), | |
$el, | |
topPosition = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Allow clicking instead of hover for dropdown menus | |
$(document).ready( function(){ | |
$('li.has_children > a').click( function(event){ | |
event.stopPropagation(); | |
$('.sub-menu').toggle(); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// FIX BLOG TAB CLASSSES ON CUSTOM POST TYPES | |
function fix_blog_tab_on_cpt( $classes, $item, $args ) { | |
if( !is_singular( 'post' ) && !is_category() && !is_tag() ) { | |
$blog_page_id = intval( get_option( 'page_for_posts' ) ); | |
if( $blog_page_id != 0 ) { | |
if( $item->object_id == $blog_page_id ) { | |
unset( $classes[ array_search( 'current_page_parent', $classes ) ] ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add 'current-menu-parent' CLASS TO CUSTOM POST TYPE MENUS | |
// make sure to add the registered custom post type to the menu 'Title Attribute' | |
add_filter('nav_menu_css_class', 'current_type_nav_class', 10, 2); | |
function current_type_nav_class($classes, $item) { | |
// Get post_type for this post | |
$post_type = get_query_var('post_type'); | |
// Go to Menus and add a menu class named: {custom-post-type}-menu-item | |
// This adds a 'current_page_parent' class to the parent menu item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( wp_is_mobile() ) { | |
} else { | |
} | |
?> |
OlderNewer