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 // remove this line | |
// add this to your wp-config.php file, before /* That's all, stop editing! Happy blogging. */ | |
define( 'WP_DEBUG', true ); | |
if (WP_DEBUG) { | |
define('WP_DEBUG_LOG', true); | |
define('WP_DEBUG_DISPLAY', false); | |
@ini_set('display_errors',0); | |
} |
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 | |
// option 1, to change text site wide | |
add_filter( 'gettext', 'fs_translate_strings_1', 20, 3 ); | |
function fs_translate_strings_1( $translation, $text, $domain ) { | |
// STRING 1 | |
$translation = str_ireplace( 'My Old Text', 'My New Text', $translation ); | |
// STRING 2 | |
$translation = str_ireplace( 'Old Text', 'New text', $translation ); | |
return $translation; |
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 | |
/** In WP All Export, add a new ID field and give it a custom Column Name, then... | |
* set the field to "Export the value returned by a PHP function"... | |
* where the function name is fs_format_get_date ... | |
* then add this function to the Function Editor, so that... | |
* the column in the export will use the proper date timezone and post time, rather than the "post_date_gmt" value | |
*/ | |
function fs_format_get_date ($id) { | |
$new_date = get_the_date($d = 'Y-m-d H:i:s', $id); | |
return $new_date; |
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 | |
function tag_cloud_shortcode($atts) { | |
// first make sure we are within a category | |
if (is_category()) { | |
// get info of current category | |
$category = get_category( get_query_var( 'cat' ) ); | |
// get current category ID |
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 | |
// ACF Group Shortcode | |
function shortcode_acf_find_my_flowers( $atts ) { | |
// begin output buffering | |
ob_start(); | |
if( have_rows('where_to_find_my_flowers') ) { |
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 | |
add_action('wp_footer', 'fs_preloader_code'); | |
function fs_preloader_code(){ | |
if(is_front_page()) { ?> | |
<div class="fs-preloader"> | |
<div class="fs-status"></div> | |
</div> | |
<?php } | |
}; | |
add_action('wp_head', 'fs_preloader_js'); |
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 | |
add_shortcode( 'fs-project-go-back', 'fs_product_go_back_shortcode' ); | |
function fs_product_go_back_shortcode( $atts ) { | |
// begin output buffering | |
ob_start(); | |
// grab the terms of the product's attribute | |
$project_cats = get_the_terms($post->ID, 'project_category'); | |
//$count = count($project_cats); | |
echo '<div class="fs-project-go-back">'; |
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 | |
$local_args = array( | |
'posts_per_page' => -1, | |
'post_type' => 'fs_local', | |
); | |
$local_posts_array = get_posts( $local_args ); | |
foreach ( $local_posts_array as $post ) { | |
update_post_meta( $post->ID, 'us_header_id', '__defaults__' ); | |
update_post_meta( $post->ID, 'us_titlebar_id', '__defaults__' ); |
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 | |
/** | |
* NOTE, this causes PAGES AND POSTS TO NOT WORK! | |
*/ | |
/** | |
* NOTE, this also requires your post type (e.g., via CPT UI) to have a Rewrite to True, | |
* and a Custom Rewrite Slug of / (forward slash) ... which probably isn't best practice. | |
* Sources: |
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 | |
// create shortcode to list all Games in Page | |
add_shortcode( 'fs-game-schedule-page-loop', 'fs_sc_game_schedule_page_loop' ); | |
function fs_sc_game_schedule_page_loop( $atts ) { | |
ob_start(); | |
// define attributes and their defaults | |
extract( shortcode_atts( array ( | |
'post_type' => 'fs_schedule', |