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 you are using BP 2.1+, this will insert a State selectbox. | |
Add the function to bp-custom.php and then visit .../wp-admin/users.php?page=bp-profile-setup | |
Remove this function after the field is created. | |
*/ | |
function bp_add_custom_state_list() { | |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
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 the times and days to the body classes | |
// e.g., date-day-wednesday date-ymd-20170614 date-month-june time-military-1317 time-pm time-early-afternoon | |
add_filter( 'body_class', 'add_date_info_to_class_names' ); | |
function add_date_info_to_class_names( $classes ) { | |
// current day of week name | |
$classes[] = 'date-day-' . strtolower(date_i18n('l')); | |
// current full date YYYYMMDD | |
$classes[] = 'date-ymd-' . strtolower(date_i18n('Ymd')); |
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 Custom Column Headers | |
function wc_csv_export_modify_column_headers( $column_headers ) { | |
$new_headers = array( | |
'carrier' => 'Carrier', | |
'line_number' => 'Line Number', | |
// add other column headers here in the format column_key => Column 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
jQuery("#main-header").insertAfter("body.home.desktop #main-content article .entry-content #above-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
<?php | |
function default_category_featured_image() { | |
global $post; | |
$featured_image_exists = has_post_thumbnail($post->ID); | |
$terms = get_the_terms($post->ID, 'jobtype'); | |
$number = sizeof ($terms); | |
if (!$featured_image_exists) { | |
$attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" ); | |
if ($attached_image) { |
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 | |
/** | |
* Order Export | |
* Within the Custom Formats > Column Mapping, add your custom column name and set the Data Source to Static, and leave the Value field blank (since we set it here instead anyway) | |
* This function takes that custom field (based on the name you set it to) and then finds the user associated with the order (based on the customer_id of the order), and then displays the user's custom field you specify. | |
*/ | |
// Tweak content of certain fields in the order export | |
function fs_wc_csv_export_trim_data( $order_data ) { | |
for( $i = 0; $i < count( $order_data ); $i++ ) { |
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 | |
/** | |
* Order Export | |
* Within the Custom Formats > Column Mapping, add your custom column name and set the Data Source to Static, and leave the Value field blank (since we set it here instead anyway) | |
* This function sees if your order or line item had any tax, and if so, it fills your custom column with "Taxed". Otherwise, the column will say "Not Taxed". | |
*/ | |
function fs_wc_csv_export_trim_data( $order_data ) { | |
for( $i = 0; $i < count( $order_data ); $i++ ) { | |
if ( isset( $order_data[ $i ]['order_line/tax_id/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 | |
/* Custom functions code goes here. */ | |
function my_theme_enqueue_styles() { | |
$parent_style = 'parent-style'; | |
// enqueue the parent theme stylesheet | |
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); |
OlderNewer