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
/* * */ | |
/*----------------[IMPORT VARIABLES]---------------*/ | |
/* * */ | |
/* | |
Push auto | |
To quickly centre a block element without having to worry about if there is any top or bottom margin already applied. | |
*/ |
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
<!-- What is Functions File in WordPress? --> | |
<!-- Functions file commonly known as functions.php file is a WordPress theme file. | |
It comes with all free and premium WordPress themes. | |
The purpose of this file is to allow theme developers to define theme features and functions. This file acts just like a WordPress plugin and can be used to add your own custom code snippets in WordPress. | |
You would find many of these code snippets on websites like https://deardorffassociatesweb.wordpress.com/ with instructions telling you to add this code in your theme’s functions.php file or a site-specific WordPress plugin. | |
Now you may be thinking what’s the difference between a site-specific WordPress plugin and functions.php file? Which one is better? |
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') ); |
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> |