| Server IP : 172.67.75.225 / Your IP : 216.73.216.185 Web Server : nginx/1.27.1 System : Linux us-1 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 User : vinodai ( 3134) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /storage/v1396/askfalguni/public_html/wp-content/themes/askfalguni/ |
Upload File : |
<?php
/**
* AskFalguni Theme — functions.php
* Premium life-guidance practice by Falguni
*/
// ── Theme Support ─────────────────────────────────────────────
add_action( 'after_setup_theme', function () {
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'html5', [ 'script', 'style', 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ] );
add_theme_support( 'custom-logo', [
'height' => 60,
'width' => 200,
'flex-height' => true,
'flex-width' => true,
] );
// Register nav menus
register_nav_menus( [
'primary' => __( 'Primary Navigation', 'askfalguni' ),
'footer' => __( 'Footer Navigation', 'askfalguni' ),
] );
} );
// ── Enqueue Google Fonts + Assets ─────────────────────────────
add_action( 'wp_enqueue_scripts', function () {
// Google Fonts — Cormorant Garamond (serif) + Hanken Grotesk (sans)
wp_enqueue_style(
'askfalguni-fonts',
'https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=Hanken+Grotesk:wght@400;500;600;700&display=swap',
[],
null
);
// Base reset
wp_enqueue_style(
'askfalguni-base',
get_template_directory_uri() . '/css/base.css',
[ 'askfalguni-fonts' ],
'1.0.0'
);
// data-hover interaction handler (loaded in footer)
wp_enqueue_script(
'askfalguni-hover',
get_template_directory_uri() . '/js/hover.js',
[],
'1.0.0',
true
);
}, 10 );
// ── Remove WP bloat ───────────────────────────────────────────
add_action( 'wp_enqueue_scripts', function () {
wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'wp-block-library-theme' );
wp_dequeue_style( 'classic-theme-styles' );
wp_dequeue_style( 'global-styles' );
}, 100 );
// ── Elementor: register brand Global Colors programmatically ──
add_action( 'elementor/kit/register_globals', function ( \Elementor\Core\Kits\Documents\Tabs\Global_Colors $tab ) {
// These can also be set manually in Elementor → Site Settings → Global Colors
// The values below are for reference — Elementor Pro 3.x reads them from the DB
} );
// ── Elementor: brand colours injected into editor palette ─────
add_filter( 'elementor/editor/localize_settings', function ( $settings ) {
$settings['color_picker_default_palette'] = [
'#1E264D', // Deep Indigo
'#F7F2E8', // Ivory
'#D8C3A5', // Warm Beige
'#6F89A6', // Dusty Blue
'#4F8A86', // Muted Teal
'#A7B59B', // Sage Green
'#7A3E48', // Muted Maroon
'#4B1F2D', // Deep Wine
'#D9D9D6', // Soft Grey
'#161D38', // Near Black
];
return \$settings;
} );
// ── Elementor: default page template → Canvas ─────────────────
add_filter( 'elementor/page_templates/canvas/before_content', '__return_false' );
// ── Woo / plugin clean-up (optional) ─────────────────────────
add_filter( 'show_admin_bar', '__return_false' ); // hide admin bar on front-end
// ── Image sizes ───────────────────────────────────────────────
add_action( 'after_setup_theme', function () {
add_image_size( 'af-portrait-hero', 800, 1000, true ); // 4:5
add_image_size( 'af-portrait-desk', 800, 960, true ); // 5:6
add_image_size( 'af-card-landscape', 1240, 700, true );
} );