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
Advanced Custom Fields | |
// Repeater | |
have_rows('repeater_field_name') | |
get_sub_field('sub_field_name') | |
the_sub_field('') | |
// Usage | |
<?php if( have_rows('repeater_field_name') ): ?> |
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
config(['$httpProvider', | |
function($httpProvider) { | |
// Change header XSRF Name to match Drupal's required token | |
$httpProvider.defaults.xsrfHeaderName = 'X-CSRF-TOKEN'; | |
} | |
]). | |
run(['$http', '$cookies', | |
function($http, $cookies) { | |
delete $cookies['XSRF-TOKEN']; |
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
“ Left double quotation mark — Option-[ | |
” Right double quotation mark — Option-Shift-[ | |
‘ Left single quotation mark — Option-] | |
’ Right single quotation mark — Option-Shift-] | |
« Double left-pointing angle quotation mark — Option-\ | |
» Double right-pointing angle quotation mark — Option-Shift-\ | |
‹ Single left-pointing angle quotation mark — Option-Shift-3 | |
› Single left-pointing angle quotation mark — Option-Shift-4 |
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
genesis_pre | |
genesis_pre_framework | |
genesis_init | |
genesis_title | |
genesis_meta | |
genesis_before | |
genesis_after | |
genesis_before_header | |
genesis_header | |
genesis_after_header |
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
* { | |
margin: 0; | |
} | |
html, body { | |
height: 100%; | |
} | |
.page-wrap { | |
min-height: 100%; | |
/* equal to footer height */ | |
margin-bottom: -142px; |
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 | |
function show_data ($data) { | |
foreach ($data as $key => $value) { | |
echo '<ul style="margin-left: 20px">'; | |
if (gettype($value) == 'array' ) { | |
echo '<li>' . $key . " : " . $value . '</li>'; | |
echo '<ul style="margin-left: 20px">'; | |
show_data($value); | |
echo '</ul>'; | |
} |
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 | |
/** | |
* Gets user information | |
*/ | |
$user_info = get_userdata($user_id); // returns the user class with standard items | |
$user_info = get_user_meta($user_id); // returns every single meta stored in the users table | |
/** |
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
<? | |
// Get Year | |
$today = new DateTime(); | |
$year = $today->format('Y'); | |
// Set Date | |
$date = new DateTime(); | |
$date->setDate(2014, 12, 31); |
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
[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /] | |
[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LEVEL" /] | |
[s2Get constant="S2MEMBER_CURRENT_USER_CUSTOM" /] | |
[s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /] | |
[s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED" /] | |
[s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS" /] | |
[s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED" /] | |
[s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY" /] | |
[s2Get constant="S2MEMBER_CURRENT_USER_EMAIL" /] | |
[s2Get constant="S2MEMBER_CURRENT_USER_FIELDS" /] |
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 | |
$user_login = get_user_field ("user_login"); | |
# Username for the current User. | |
$user_email = get_user_field ("user_email"); | |
# Email Address for the current User. | |
$first_name = get_user_field ("first_name"); | |
# First Name for the current User. |
NewerOlder