This file contains hidden or 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 get_image_attachments( $size = 'thumbail', $ID ) { | |
$featured_image_id = get_post_thumbnail_id( $ID ); | |
$args = array( | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image', | |
'numberposts' => -1, | |
'orderby' => 'menu_order', | |
'order' => 'ASC', | |
'post_parent' => $ID, | |
'exclude' => $featured_image_id |
This file contains hidden or 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 | |
// Twitter date format example: "created_at": "Mon Jun 27 19:32:19 +0000 2011" | |
function from_apachedate( $date ) { | |
list( $D, $M, $d, $h, $m, $s, $y ) = sscanf( $date, "%s %s %2d %2d:%2d:%2d +0000 %4d" ); | |
return strtotime( "$d $M $y $h:$m:$s" ); | |
} | |
// human_time_diff is a WordPress function | |
echo human_time_diff( from_apachedate( $item->created_at ), current_time( 'timestamp' ) ); |
This file contains hidden or 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(preg_match('/vimeo/', $data['url'])){ | |
$url = '//player.vimeo.com/video/'.end(explode('/', $data['url'])); | |
echo "<iframe src='$url' width='560' height='315' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"; | |
echo "<img src='".unserialize(file_get_contents("http://vimeo.com/api/v2/video/".end(explode('/', $data['url'])).".php"))[0]['thumbnail_medium']."' />"; |
This file contains hidden or 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 | |
// gets the ID from a custom field to show posts on a specific page | |
$buildType = get_post_meta($post->ID, 'build_type_id', true); | |
// run query | |
query_posts(array( | |
'post_type' => 'portfolio', | |
'showposts' => -1, | |
'tax_query' => array( | |
array( |
This file contains hidden or 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 | |
//Simple Ajax Login Form | |
//Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/ | |
//html | |
<form id="login" action="login" method="post"> | |
<h1>Site Login</h1> | |
<p class="status"></p> | |
<label for="username">Username</label> | |
<input id="username" type="text" name="username"> |
This file contains hidden or 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 getUserIP() | |
{ | |
$client = @$_SERVER['HTTP_CLIENT_IP']; | |
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; | |
$remote = $_SERVER['REMOTE_ADDR']; | |
if(filter_var($client, FILTER_VALIDATE_IP)) | |
{ |
This file contains hidden or 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 | |
// Example 1 | |
$show_after_p = 2; | |
$content = apply_filters('the_content', $post->post_content); | |
if(substr_count($content, '<p>') > $show_after_p) | |
{ | |
$contents = explode("</p>", $content); | |
$p_count = 1; | |
foreach($contents as $content) | |
{ |
This file contains hidden or 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
[text* your-name placeholder "Name*"] | |
[email* your-email placeholder "Email*"] | |
[text your-subject placeholder "Subject*"] | |
<div class="message-body"> | |
[textarea* your-message placeholder "Message*"] | |
</div> | |
<div class="submit-button"> |
This file contains hidden or 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 elevation_google_fonts_url() { | |
$font_url = ''; | |
if ( 'off' !== _x( 'on', 'Google font: on or off', 'elevation' ) ) { | |
$font_url = add_query_arg( 'family', urlencode( 'Montserrat:400,700,800|Open Sans:400,300,600,700,800|Roboto:300,400,500,700' ), "//fonts.googleapis.com/css" ); | |
} | |
return $font_url; | |
} | |
function elevation_scripts() { | |
wp_enqueue_style( 'elevation-google-fonts', elevation_google_fonts_url() ); |
This file contains hidden or 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
============================= | |
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html | |
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html | |
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html | |
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html | |
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html | |
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html | |
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html |