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 cameronjonesweb_404_fix() { | |
global $wp_query; | |
if ( $wp_query->is_404 ) { | |
$wp_query->posts = array(); | |
$wp_query->current_post = 0; | |
$wp_query->post = null; | |
} | |
} |
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 cameronjonesweb_jquery_fix() { | |
// Restore old jQuery. | |
wp_deregister_script( 'jquery' ); | |
wp_deregister_script( 'jquery-core' ); | |
wp_register_script( 'jquery-core', get_template_directory_uri() . '/includes/js/jquery-1.12.4.min.js', array(), '1.12.4', false ); | |
wp_register_script( 'jquery', false, array( 'jquery-core' ), null, false ); | |
wp_enqueue_script( 'jquery' ); | |
} |
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 | |
/** | |
* Delete the option setting for the default category | |
* | |
* @link https://cameronjonesweb.com.au/blog/how-to-remove-the-uncategorised-category-from-wordpress-and-woocommerce | |
*/ | |
function cameronjonesweb_delete_default_category_option() { | |
if ( get_option( 'default_category' ) ) { | |
delete_option( 'default_category' ); | |
} |
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 cameronjonesweb_colour_scheme() { | |
return array( | |
array( | |
'name' => 'White', | |
'slug' => 'white', | |
'color' => '#ffffff', | |
), | |
array( |
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 cameronjonesweb_acf_setup() { | |
acf_add_options_page( | |
array( | |
'page_title' => 'Theme Settings', | |
'menu_slug' => 'cameronjonesweb-theme-settings', | |
) | |
); | |
acf_add_local_field_group( | |
array( |
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 cameronjonesweb_wrap_classic_posts( $block_content, $block ) { | |
if ( is_null( $block['blockName'] ) && ! empty( trim( $block_content ) ) ) { | |
$output = '<div class="classic-block">'; | |
$output .= $block_content; | |
$output .= '</div>'; | |
$block_content = $output; | |
} | |
return $block_content; | |
} |
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_filter( 'acf/register_block_type_args', 'cameronjonesweb_automatically_enqueue_block_stylesheet' ); | |
function cameronjonesweb_automatically_enqueue_block_stylesheet( $args ) { | |
if ( empty( $args['enqueue_style'] ) ) { | |
$file = get_template_directory_uri() . '/blocks/' . ltrim( $args['name'], 'acf/' ) . '/block.css'; | |
if ( file_exists( str_replace( get_template_directory_uri(), get_template_directory(), $file ) ) ) { | |
$args['enqueue_style'] = $file; | |
} | |
} |
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(document).ready(function($){ | |
var custom_uploader; | |
var $btn; | |
$('.image_upload_button').click(function(e) { | |
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_id = 1; | |
$edd_api = new EDD_API(); | |
$public_key = $edd_api->get_user_public_key( $user_id ); | |
if ( empty( $public_key ) ) { | |
$edd_api->generate_api_key( $user_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 | |
$form_id = 1; | |
$field_id = 1; | |
add_filter( "gform_field_content_{$form_id}_{$field_id}", 'gfield_render_the_content', 10, 5 ); | |
function gfield_render_the_content( $content, $field, $value, $lead_id, $form_id ) { | |
$content = apply_filters( 'the_content', get_the_content() ); | |
return $content; | |
} |