View bootstrap-3-navbar-dropdown-slide-effect.css
@media (max-width: 767px) {
.navbar-nav .dropdown-menu {
position: static;
float: none;
width: 100%;
margin-top: 0;
background-color: transparent;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
View bootstrap-3-navbar-dropdown-slide-effect.js
$( document ).ready( function() {
$( '.dropdown' ).on( 'show.bs.dropdown', function() {
$( this ).find( '.dropdown-menu' ).first().stop( true, true ).slideDown( 150 );
} );
$('.dropdown').on( 'hide.bs.dropdown', function(){
$( this ).find( '.dropdown-menu' ).first().stop( true, true ).slideUp( 150 );
} );
} );
View responsive-YouTube-embed-with-max-width.js
( function( $ ) {
'use strict';
// Assumptions:
// 1. The post content (and the video) will be inside a wrapper with class .post-content
// 2. The video aspect ratio is 16:9
// 3. The video will take the full width of the .post-content but will not go beyond a certain width
$( window ).on( 'load resize', function() {
View responsive-YouTube-embed.js
( function( $ ) {
'use strict';
// We'll assume that the post content (and the video) will be inside a wrapper with class .post-content
// and the video aspect ratio is 16:9
$( window ).on( 'load resize', function() {
// Take the width of the wrapper
var contentWidth = $( '.post-content' ).width();
View in_array_r.php
<?php
/* Check if an item $search_item is in the multidimensional array $items */
function in_array_r( $search_item, $items, $strict = false ) {
foreach ( $items as $item ) {
if ( ( $strict ? $item === $search_item : $item == $search_item ) || ( is_array( $item ) && in_array_r( $search_item, $item, $strict ) ) ) {
return true;
}
}
View wp-remove-default-image-sizes.php
<?php
/*
* Custom filter to remove default image sizes from WordPress.
*/
/* Add the following code in the theme's functions.php and disable any unset function as required */
function remove_default_image_sizes( $sizes ) {
/* Default WordPress */
unset( $sizes[ 'medium' ]); // Remove Thumbnail (150 x 150 hard cropped)
View wp-child-page-conditional.php
<?php
/*
* Check if the current pae is a direct child of another page.
* Accept's page ID, page slug or page title as parameters to identify the parent.
*/
/* Add the following code in the theme's functions.php */
function is_child( $parent = '' ) {
global $post;
View wp-config-partial.php
<?php
/*
* Unified variables
*/
$charset = 'UTF-8';
$collate = '';
/*
* Set variables conditianlly based on current environment
View keymap.cson
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
View css-snippet-for-responsive-table-stylized.css
/* CSS Snippet For Responsive Table - Stylized */
/* Basic */
* {
box-sizing: border-box;
}
table {
border-spacing: 0px;