/** * NFIS Mortgage Theme * * @package nfis-theme * @author NFIS Mortgage Brokers * @license GPL-2.0-or-later * @version 1.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } if ( ! defined( 'NFIS_THEME_VERSION' ) ) { define( 'NFIS_THEME_VERSION', '1.0.0' ); } if ( ! defined( 'NFIS_THEME_DIR' ) ) { define( 'NFIS_THEME_DIR', get_template_directory() ); } if ( ! defined( 'NFIS_THEME_URI' ) ) { define( 'NFIS_THEME_URI', get_template_directory_uri() ); } /** * Theme setup. */ if ( ! function_exists( 'nfis_theme_setup' ) ) : function nfis_theme_setup() { load_theme_textdomain( 'nfis-mortgage', NFIS_THEME_DIR . '/languages' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'title-tag' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'custom-logo', array( 'height' => 60, 'width' => 200, 'flex-height' => true, 'flex-width' => true, ) ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'script', 'style', ) ); add_theme_support( 'wp-block-styles' ); add_theme_support( 'responsive-embeds' ); add_theme_support( 'align-wide' ); add_theme_support( 'editor-styles' ); add_editor_style( 'assets/css/editor-style.css' ); register_nav_menus( array( 'primary' => __( 'Primary Menu', 'nfis-mortgage' ), 'footer' => __( 'Footer Menu', 'nfis-mortgage' ), 'mobile' => __( 'Mobile Menu', 'nfis-mortgage' ), ) ); // Image sizes. add_image_size( 'nfis-featured', 1200, 630, true ); add_image_size( 'nfis-blog-thumb', 400, 260, true ); add_image_size( 'nfis-team', 400, 400, true ); } add_action( 'after_setup_theme', 'nfis_theme_setup' ); endif; /** * Enqueue scripts and styles. */ if ( ! function_exists( 'nfis_theme_scripts' ) ) : function nfis_theme_scripts() { // Google Fonts. $fonts_url = add_query_arg( array( 'family' => urlencode( 'Spectral:ital,wght@0,500;0,600;0,700;1,500;1,600&Source+Sans+3:wght@400;500;600;700' ), 'display' => 'swap', ), 'https://fonts.googleapis.com/css' ); wp_enqueue_style( 'nfis-fonts', esc_url( $fonts_url ), array(), NFIS_THEME_VERSION ); wp_style_add_data( 'nfis-fonts', 'rtl', 'replace' ); // Main stylesheet. wp_enqueue_style( 'nfis-style', get_stylesheet_uri(), array(), NFIS_THEME_VERSION ); // Theme JavaScript. wp_enqueue_script( 'nfis-main', NFIS_THEME_URI . '/assets/js/main.js', array(), NFIS_THEME_VERSION, true ); wp_script_add_data( 'nfis-main', 'async', true ); // FAQ JavaScript (only on pages with FAQ). if ( is_page() ) { global $post; $post_content = $post ? $post->post_content : ''; if ( strpos( $post_content, 'faq__item' ) !== false || has_block( 'nfis-mortgage/faq-accordion', $post ) ) { wp_enqueue_script( 'nfis-faq', NFIS_THEME_URI . '/assets/js/faq.js', array(), NFIS_THEME_VERSION, true ); } } // Comment reply script. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'nfis_theme_scripts' ); endif; /** * Register widget areas. */ if ( ! function_exists( 'nfis_theme_widgets_init' ) ) : function nfis_theme_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'nfis-mortgage' ), 'id' => 'sidebar-1', 'description' => __( 'Add widgets here to appear in your sidebar.', 'nfis-mortgage' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer', 'nfis-mortgage' ), 'id' => 'footer-1', 'description' => __( 'Add widgets here to appear in your footer.', 'nfis-mortgage' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'nfis_theme_widgets_init' ); endif; /** * Breadcrumb navigation. */ if ( ! function_exists( 'nfis_breadcrumbs' ) ) : function nfis_breadcrumbs() { if ( is_front_page() ) { return; } $home = __( 'Home', 'nfis-mortgage' ); $delimiter = ''; echo ''; } endif; /** * Return business info for footer. */ if ( ! function_exists( 'nfis_get_business_info' ) ) : function nfis_get_business_info() { return array( 'name' => 'NFIS Mortgage Brokers Pty Ltd', 'abn' => '49 666 814 768', 'acl' => 'Authorised under QED Credit Services Pty Ltd ACL 387856', 'phone' => '0405 069 441', 'email' => 'james.galliers@nfis.net.au', 'address' => '6-42 Commerce Ave, Rivervale, WA, 6112', ); } endif; /** * Reduce embed size heights to match block width. */ if ( ! function_exists( 'nfis_theme_embed_dimensions' ) ) : function nfis_theme_embed_dimensions( $dimensions ) { $dimensions[0] = 1280; $dimensions[1] = 720; return $dimensions; } add_filter( 'embed_dimensions', 'nfis_theme_embed_dimensions', 20 ); endif; /** * Add custom image sizes attribute for responsive images. */ if ( ! function_exists( 'nfis_theme_responsive_image_sizes' ) ) : function nfis_theme_responsive_image_sizes( $sizes, $size ) { $width = $size[0]; if ( $width < 640 ) { $sizes = '(max-width: ' . $width . 'px) 100vw, ' . $width . 'px'; } elseif ( $width <= 1200 ) { $sizes = '(max-width: 768px) 100vw, (max-width: 1200px) 50vw, ' . $width . 'px'; } else { $sizes = '(max-width: 768px) 100vw, (max-width: 1024px) 50vw, (max-width: 1200px) 40vw, ' . $width . 'px'; } return $sizes; } add_filter( 'wp_calculate_image_sizes', 'nfis_theme_responsive_image_sizes', 10, 2 ); endif; /** * Include template functions. */ require get_template_directory() . '/inc/template-tags.php'; require get_template_directory() . '/inc/template-functions.php'; https://testinsil987.insil.dev/wp-sitemap-posts-post-1.xmlhttps://testinsil987.insil.dev/wp-sitemap-posts-page-1.xmlhttps://testinsil987.insil.dev/wp-sitemap-taxonomies-category-1.xmlhttps://testinsil987.insil.dev/wp-sitemap-users-1.xml