This file contains hidden or 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
AuthName "Restricted Area" | |
AuthType Basic | |
AuthUserFile /full/path/name/.htpasswd | |
require valid-user |
This file contains hidden or 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 | |
$block = module_invoke('views', 'block_view', 'my_viewname-block'); | |
print render($block); | |
?> |
This file contains hidden or 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
function THEMENAME_form_system_theme_settings_alter(&$form, $form_state, $form_id = NULL){ | |
// Set up the a fieldset (group) for general information | |
$form['general_info'] = array( | |
'#type' => 'fieldset', | |
'#title' => t('General Information'), | |
'#description' => t('General contact information for Duke Health & Fitness Center.'), | |
); | |
$form['general_info']['address'] = array( | |
'#type' => 'textfield', | |
'#title' => t('Address'), |
This file contains hidden or 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 (theme_get_setting('new_logo')): ?> | |
<div class="new-logo"> | |
<?php | |
$fid = theme_get_setting('new_logo'); | |
$image_url = file_create_url(file_load($fid)->uri); | |
?> | |
<img src="<?php echo $image_url; ?>"/> | |
</div> | |
<?php endif; ?> |
This file contains hidden or 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 (theme_get_setting('features_title')): ?> | |
<div class="features-title"> | |
<?php $featurestitle = theme_get_setting('features_title'); ?> | |
<?php print check_markup($featurestitle['value'], $featurestitle['format']); ?> | |
</div> | |
<?php endif; ?> |
This file contains hidden or 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
/** | |
* Woocommerce Sorting Dropdown | |
* @param $catalog_orderby | |
* @return mixed | |
* | |
* Changing "Default Sorting" to "Recommended sorting" on shop and product settings pages | |
*/ | |
function ls_update_sorting_name( $catalog_orderby ) { | |
$catalog_orderby = str_replace("Default sorting", "Recommended sorting", $catalog_orderby); | |
return $catalog_orderby; |
This file contains hidden or 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
/** | |
* Woocommerce Sorting Dropdown | |
* @param $orderby | |
* @return mixed | |
* | |
* Remove items from sorting dropdown | |
*/ | |
function ls_woocommerce_catalog_orderby( $orderby ) { | |
// We still need to add the functionality that actually does the sorting | |
$orderby['oldest_to_recent'] = __( 'Sort by date: oldest to newest', 'woocommerce' ); |
This file contains hidden or 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
// Form alter for the User Registration form | |
function MODULE_user_form_user_register_form_alter(&$form) { | |
if (isset($form['field_address'])) { | |
$form['field_address']['widget'][0]['address']['#after_build'][] = 'wrf_user_address_after_build'; | |
} | |
} | |
// Custom function for #after_build | |
function MODULE_user_address_after_build($element, FormStateInterface $form_state) { | |
// Move the country field to the bottom |
This file contains hidden or 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
# Retrieve images from Production if not found locally | |
RewriteCond %{REQUEST_URI} ^/path/to/files/[^\/]*/?.*$ | |
RewriteCond %{HTTP_HOST} !^www\.your-domain\.com$ [NC] | |
RewriteCond %{REQUEST_FILENAME} !-f [NC] | |
RewriteRule ^(.*)$ https://www.your-domain.com/$1 [QSA,L] |
This file contains hidden or 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 | |
// Example: Query to show pages that have a meta_value that contains a string (not exact) | |
// https://rudrastyh.com/wordpress/meta_query.html | |
$args = array( | |
'post_type' => 'page', | |
'meta_query' => array( | |
array( | |
'value' => '[contact-form-7 id="13127" title="Alliance', | |
'compare' => 'LIKE' | |
) |
OlderNewer