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
<ul> | |
<?php | |
// nggdb::get_gallery( <gallery ID> ) | |
// Get an array of nggImage objects. | |
$slides = nggdb::get_gallery( 1 ); | |
foreach( $slides as $slide ) { | |
// To see all the methods and attributes available, nextgen-gallery/lib/image.php | |
echo '<li><img src="'.($slide->cached_singlepic_file( 872, 331 )).'" alt="'.esc_attr($slide->alttext).'" /></li>'; | |
} | |
?> |
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
<!-- I noticed that Twitter Bootstrap has a feature to make your navigation work on mobile. | |
It just appears that the documentation is missing for it. | |
Take the navigation bar and then add a toggle button and wrap the navigation list in '.nav-collapse'. | |
--> | |
<nav class="navbar navbar-fixed-top"> | |
<div class="navbar-inner"> | |
<div class="container"> | |
<!-- Add toggle button --> | |
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> |
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
/* Add a wave alignment to your title text using Sass, Compass, and Lettering.js. | |
* | |
* Lettering.js wraps each letter with a span with a class of .char<#>. | |
* Compass provides math functions including the sin which provides the wave form. | |
*/ | |
$length: 11; // The word is 11 letters long | |
@for $i from 1 through $length { | |
.char#{$i} { | |
@include transform(translateY( sin(($i - 1)/($length - 1)*2*pi()) * -25px) ); |
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 | |
/** | |
* Retrive the tuples of metadata in a given set of post-types. | |
* | |
* @param $metakeys string|array - The metakeys to be the tuple elements | |
* @param $post_types string|array optional - The post-types to limit the query on. Defaults to the current post-type | |
* | |
* <?php | |
* $cities = get_postmeta_tuples( array( 'city', 'state' ), 'chapters' ); | |
* ?> |
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 | |
/** | |
* 1. Add this to your theme's functions.php file. | |
* 2. Create an 'ajax' folder in your theme directory. | |
* 3. Create a PHP file to handle the AJAX call in the ajax folder. | |
* 4. From Javascript, make an AJAX call using jQuery: | |
* 5. $.get( window.themeSettings.ajaxUrl, {action: window.themeSettings.themeAjaxAction, template: 'YOUR TEMPLATE NAME (MINUS THE .php EXTENSION)'}, function( data ) { } ); | |
*/ | |
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
?colorize=40,10,-40&contrast=2 | |
?colorize=30,10,-40&contrast=5&brightness=-40 | |
?colorize=10,10,-20&contrast=5&brightness=-10 | |
?colorize=10,10,-20&contrast=5&brightness=15 | |
?colorize=-20,10,20&contrast=5&brightness=-30 | |
?colorize=-20,10,20&contrast=5&brightness=-30&filter=blurgaussian |
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 send_extra_media_info( $html, $send_id, $attachment ) { | |
@header( "X-Attachment-ID: " . intval( $send_id ) ); | |
foreach( array('post_title', 'image-size' ) as $key ) { | |
if( array_key_exists($key, $attachment) ) { | |
@header( "X-".$key.": " . str_replace( array( "\r", "\n"), ' ', $attachment[$key] ) ); | |
} | |
} |
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 | |
/** | |
* Retrieve the bare structure of a nav menu instead of the formatted output. | |
* | |
* @param unknown $args - the same arguments you pass into wp_nav_menu (the fallback and output arguments do not apply) | |
*/ | |
function prefix_get_nav_menu( $args=array() ) { | |
$args = wp_parse_args( $args, array() ); | |
$args = apply_filters( 'wp_nav_menu_args', $args ); | |
$args = (object) $args; |
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
// Open external links in new windows | |
jQuery(document).ready(function($) { | |
var re = new RegExp( '^([^/]+:)?//([^/]+\\.)?' + window.location.host.replace(/\./g, '\\.') + '/'); | |
$('body').on('click', 'a', function(event) { | |
if(!re.test(this.href)) { | |
window.open(this.href, '_blank'); | |
return 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 | |
register_post_type( 'custom_post_type_name', array( | |
'capabilities' => array( | |
'create_posts' => false, | |
) | |
)); |
OlderNewer