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 custom styles to the styleselect dropdown | |
* | |
* @since required+ Foundation 0.5.0 | |
* | |
* @param array $settings | |
* @return array | |
*/ |
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
# Additional SASS Script functions | |
require 'sass' | |
require 'base64' | |
module Sass::Script::Functions | |
def base64encode(string) | |
assert_type string, :String | |
file = "."+string.value | |
data = File.open(file, "rb") {|io| io.read} | |
data = [data].flatten.pack("m").gsub("\n","") |
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
if(!Modernizr.svg){ | |
$("img.svg").each(function(){ | |
var src = this.src.replace('.svg', '.png'); | |
this.src = src; | |
}); | |
} |
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
(function() { | |
var script, | |
scripts = document.getElementsByTagName('script')[0]; | |
function load(url) { | |
script = document.createElement('script'); | |
script.async = true; | |
script.src = url; | |
scripts.parentNode.insertBefore(script, scripts); |
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
module Sass::Script::Functions | |
def file_exists(image_file) | |
path = Dir.getwd + "/" + image_file.value | |
Sass::Script::Bool.new(File.exists?(path)) | |
end | |
end |
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 $testimonials = new WP_Query('post_type=testimonial'.ks_query('testimonials')); ?> | |
<div class="testimonials"> | |
<?php while( $testimonials->have_posts() ): $testimonials->the_post(); ?> | |
<blockquote class="testimonial"> | |
<?php the_content(); ?> | |
<footer> | |
<p> | |
<?php the_title(); ?> | |
</p> |
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 $attachments = new Attachments( 'attachments' ); ?> | |
<?php if( $attachments->exist() ) : ?> | |
<h3>Attachments</h3> | |
<ul> | |
<?php while( $attachments->get() ) : ?> | |
<li> | |
ID: <?php echo $attachments->id(); ?><br /> | |
Type: <?php echo $attachments->type(); ?><br /> | |
Subtype: <?php echo $attachments->subtype(); ?><br /> | |
URL: <?php echo $attachments->url(); ?><br /> |
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 my_attachments( $attachments ) | |
{ | |
$args = array( | |
// title of the meta box (string) | |
'label' => 'My Attachments', | |
// all post types to utilize (string|array) |
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
function is_blog () { | |
global $post; | |
$posttype = get_post_type($post ); | |
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ; | |
} | |
Usage: | |
<?php if (is_blog()) { echo 'You are on a blog page'; } ?> |