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 get_cached_external_json($url) { | |
| $transient_key = 'our_fetched_json_' . md5($url); | |
| $option_key = 'our_fetched_json_backup_' . md5($url); | |
| $cached_data = get_transient($transient_key); | |
| if (false !== $cached_data) { | |
| return $cached_data; | |
| } |
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
| /** | |
| * Add theme support. | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @return void | |
| */ | |
| if ( ! function_exists( 'rabindra_tharu_setup' ) ) { | |
| function rabindra_tharu_setup() { |
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
| add_action( 'graphql_register_types', function() { | |
| // Site Logo | |
| register_graphql_field( 'RootQuery', 'siteLogo', [ | |
| 'type' => 'MediaItem', | |
| 'description' => __( 'The logo set in the customizer', 'your-textdomain' ), | |
| 'resolve' => function() { | |
| $logo_id = get_theme_mod( 'custom_logo' ); | |
| if ( ! isset( $logo_id ) || ! absint( $logo_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
| //Dequeue JavaScripts | |
| function theme_dequeue_unnecessary_scripts() { | |
| wp_dequeue_script( 'jquery-waypoints' ); | |
| wp_deregister_script( 'jquery-waypoints' ); | |
| wp_dequeue_script( 'jquery-counterup' ); | |
| wp_deregister_script( 'jquery-counterup' ); | |
| } | |
| add_action( 'wp_print_scripts', 'theme_dequeue_unnecessary_scripts', 100 ); |