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 | |
$attachment_id = $page->ID; | |
$current = get_the_ID(); | |
$attachment = get_post( $attachment_id ); | |
$args = array( | |
'post_type' => 'attachment', | |
'post_parent' => $current, | |
'post_mime_type' => 'image', | |
'post_status' => null, | |
'numberposts' => -1, |
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
<!-- | |
Inspired by Jardson Almeida | |
https://dribbble.com/shots/2518516-Nike-Promotion-Ads-Parallax-Effect | |
--> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Nike Parallax Cards</title> |
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 | |
if ( get_query_var('paged') ) { | |
$paged = get_query_var('paged'); | |
} elseif ( get_query_var('page') ) { // 'page' is used instead of 'paged' on Static Front Page | |
$paged = get_query_var('page'); | |
} else { | |
$paged = 1; | |
} | |
$custom_query_args = 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
<?php | |
// $the_query would just be a standard WP_Query | |
if ( $the_query->have_posts() ) : | |
$counter = 1; | |
while ( $the_query->have_posts() ) : $the_query->the_post(); | |
if ( $counter % columns == 1 ) { | |
// do something at the start of your 'row' |
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_action('wp_enqueue_scripts', 'enqueue'); | |
function enqueue(){ | |
//Font Awesome | |
wp_register_script('font-awesome', '//use.fontawesome.com/releases/v5.0.6/js/all.js'); | |
//enqueue scripts | |
wp_enqueue_script(array('jquery','font-awesome')); |
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
$args = array( | |
'supports' => array( 'title', 'editor', 'thumbnail', 'publicize') | |
) |
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 /* Loop through Promotion and Display Vendors as heading and promo posts within */ | |
$post_type = 'promotion'; | |
// Get all the taxonomies for this post type | |
$object = 'post'; | |
$output = 'objects'; | |
$taxonomies = get_object_taxonomies( $object, $output ); | |
$exclude = array( 'post_tag','post_format','category' ); | |
foreach( $taxonomies as $taxonomy ) : |
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 | |
$tax_args = array( | |
'orderby' => 'title', | |
'order' => 'ASC', | |
'hide_empty' => true, | |
); | |
$terms = get_terms('vendors', $tax_args); | |
foreach($terms as $term){ |
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 Title and Alt Attribute to WordPress Image the_post_thumbnail */ | |
function ac_add_img_title( $attr, $attachment = null ) { | |
$img_title = trim( strip_tags( $attachment->post_title ) ); | |
// or get the title instead of image title $attr['title'] = the_title_attribute( 'echo=0' ); | |
$attr['title'] = $img_title; | |
$attr['alt'] = $img_title; | |
return $attr; | |
} |
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
Option Explicit | |
Function LookupCSVResults(lookupValue As Variant, lookupRange As Range, resultsRange As Range) As String | |
Dim s As String 'Results placeholder | |
Dim sTmp As String 'Cell value placeholder | |
Dim r As Long 'Row | |
Dim c As Long 'Column | |
Const strDelimiter = "|||" 'Makes InStr more robust | |
s = strDelimiter |
OlderNewer