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 ( is_user_logged_in() ) { ?> | |
<h1>Firmware Updates</h1> | |
<?php $current_user = wp_get_current_user(); ?> | |
<h3 style="margin-bottom: 6px;">Welcome, <?php echo $current_user->user_firstname; ?>!</h3> | |
<p>Your registered product software and updates are listed below.<br/> | |
Need to register another product on your account? Please fill out a <a data-fancybox href="#updateaccount">request form</a>.</p> | |
<?php // Software notes |
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 // Software notes | |
if( have_rows('products', $userID) ): ?> | |
<?php while( have_rows('products', $userID) ): the_row(); | |
$product = get_sub_field('product'); //get repeater post object | |
if ($product): | |
//print_r($product); |
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 |
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
<?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 /* 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
$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 | |
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
<?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 | |
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( |
NewerOlder