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 | |
// Show something only if the user is logged / admin. | |
// To be used in the current theme files - front. | |
if (current_user_can('manage_options')){ ?> | |
<div class="work"> | |
<div class="work_layer"> | |
<div class="device-content row"> | |
<div class="work_content right"> | |
<span class="f_13 uppercase sub_title">Web</span> |
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 | |
// Get the_content by post id | |
echo apply_filters('the_content', get_post_field('post_content', $post_id)); | |
// Featured Image display | |
$attr = array( | |
'src' => $src, | |
'class' => "attachment-$size", | |
'alt' => trim(strip_tags( $wp_postmeta->_wp_attachment_image_alt )), |
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 | |
// Show something only if the user is logged / admin. | |
// To be used in the current theme files - front. | |
if (current_user_can('manage_options')){ ?> | |
<div class="work"> | |
<div class="work_layer"> | |
<div class="device-content row"> | |
<div class="work_content right"> | |
<span class="f_13 uppercase sub_title">Web</span> |
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
//JS Snippets | |
// Gets the browser prefix | |
var browserPrefix; | |
navigator.sayswho= (function(){ | |
var N = navigator.appName, ua = navigator.userAgent, tem; | |
var M = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); | |
if(M && (tem = ua.match(/version\/([\.\d]+)/i))!= null) M[2] = tem[1]; | |
M = M? [M[1], M[2]]: [N, navigator.appVersion,'-?']; | |
M = M[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
<?php | |
// http://johnford.is/programmatically-pull-attachments-from-wordpress-posts/ | |
// http://www.wprecipes.com/how-to-show-wordpress-post-attachments | |
// get all of the images attached to the current post | |
function _get_images($size = 'thumbnail') { | |
global $post; | |
$photos = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ); |