| Server IP : 85.112.90.236 / Your IP : 192.168.1.26 Web Server : Apache System : Linux 85-112-90-236.cprapid.com 6.12.0-211.7.3.el10_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 12:46:58 EDT 2026 x86_64 User : ftechme ( 1002) PHP Version : 8.2.32 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/ftechme/public_html/wp-content/mu-plugins/ |
Upload File : |
<?php
/**
* Plugin Name: Faisal Technology Site Style
* Description: Custom presentation layer for ftech.me.
* Version: 0.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action(
'wp_enqueue_scripts',
function () {
wp_register_style( 'ftech-site-style', false, array(), '0.1.0' );
wp_enqueue_style( 'ftech-site-style' );
wp_add_inline_style(
'ftech-site-style',
<<<'CSS'
:root {
--ft-ink: #15201d;
--ft-muted: #5c6863;
--ft-line: #dce6df;
--ft-paper: #f7faf7;
--ft-white: #ffffff;
--ft-forest: #1f5f48;
--ft-moss: #7aa35a;
--ft-sky: #d9ecf2;
--ft-sand: #f1e7d5;
--ft-shadow: 0 20px 60px rgba(16, 42, 34, 0.12);
}
body {
background: var(--ft-paper);
color: var(--ft-ink);
}
.site-header {
border-bottom: 1px solid rgba(21, 32, 29, 0.08);
}
.site-branding .site-title {
font-weight: 800;
}
.page .entry-header {
display: none;
}
.ft-site {
font-size: 18px;
line-height: 1.7;
color: var(--ft-ink);
}
.ft-site h1,
.ft-site h2,
.ft-site h3 {
color: var(--ft-ink);
line-height: 1.08;
letter-spacing: 0;
}
.ft-site h1 {
font-size: clamp(2.5rem, 6vw, 5.7rem);
max-width: 980px;
margin: 0;
}
.ft-site h2 {
font-size: clamp(2rem, 4vw, 3.3rem);
margin: 0 0 18px;
}
.ft-site h3 {
font-size: 1.35rem;
margin: 0 0 10px;
}
.ft-site p {
color: var(--ft-muted);
margin: 0 0 18px;
}
.ft-hero {
position: relative;
min-height: min(820px, calc(100vh - 72px));
display: grid;
align-items: end;
overflow: hidden;
background: #13231e;
isolation: isolate;
}
.ft-hero__media {
position: absolute;
inset: 0;
background:
linear-gradient(90deg, rgba(10, 23, 19, 0.86), rgba(10, 23, 19, 0.48) 47%, rgba(10, 23, 19, 0.12)),
url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=2400&q=82") center / cover;
z-index: -1;
}
.ft-hero__content {
width: min(1180px, calc(100% - 40px));
margin: 0 auto;
padding: 120px 0 96px;
}
.ft-hero .ft-kicker,
.ft-hero h1,
.ft-hero .ft-lead {
color: #fff;
}
.ft-lead {
max-width: 760px;
font-size: 1.18rem;
}
.ft-kicker {
color: var(--ft-forest);
font-size: 0.84rem;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.12em;
margin-bottom: 14px;
}
.ft-actions {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin-top: 30px;
}
.ft-button {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 48px;
padding: 0 22px;
border-radius: 8px;
font-weight: 800;
text-decoration: none;
border: 1px solid transparent;
}
.ft-button--primary {
background: var(--ft-forest);
color: #fff;
}
.ft-button--ghost {
background: rgba(255, 255, 255, 0.12);
border-color: rgba(255, 255, 255, 0.45);
color: #fff;
backdrop-filter: blur(8px);
}
.ft-band,
.ft-split,
.ft-cards,
.ft-cta,
.ft-contact,
.ft-photo-grid {
width: min(1180px, calc(100% - 40px));
margin: 0 auto;
}
.ft-band {
padding: 92px 0;
}
.ft-band--intro {
padding-top: 78px;
}
.ft-section-head {
max-width: 800px;
margin-bottom: 34px;
}
.ft-cards {
display: grid;
gap: 18px;
}
.ft-cards--three {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ft-cards--two,
.ft-contact {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ft-card {
background: var(--ft-white);
border: 1px solid var(--ft-line);
border-radius: 8px;
padding: 28px;
box-shadow: 0 8px 28px rgba(20, 41, 34, 0.06);
}
.ft-card--quiet {
background: #eef6f0;
}
.ft-card--accent {
background: #17372e;
border-color: #17372e;
}
.ft-card--accent h2,
.ft-card--accent p,
.ft-card--accent li {
color: #fff;
}
.ft-split {
display: grid;
grid-template-columns: 1.05fr 0.95fr;
gap: 54px;
align-items: center;
padding: 88px 0;
}
.ft-checks {
margin: 20px 0 26px;
padding: 0;
list-style: none;
display: grid;
gap: 10px;
}
.ft-checks li {
position: relative;
padding-left: 28px;
color: var(--ft-ink);
}
.ft-checks li::before {
content: "";
position: absolute;
left: 0;
top: 0.65em;
width: 10px;
height: 10px;
border-radius: 999px;
background: var(--ft-moss);
}
.ft-link {
color: var(--ft-forest);
font-weight: 800;
}
.ft-stats {
display: grid;
gap: 16px;
}
.ft-stats div {
background: linear-gradient(135deg, #17372e, #26624e);
border-radius: 8px;
padding: 30px;
box-shadow: var(--ft-shadow);
}
.ft-stats strong {
display: block;
color: #fff;
font-size: 2.4rem;
line-height: 1;
margin-bottom: 10px;
}
.ft-stats span {
color: rgba(255, 255, 255, 0.82);
}
.ft-gallery-preview,
.ft-photo-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 16px;
}
.ft-photo {
min-height: 360px;
border-radius: 8px;
background-size: cover;
background-position: center;
box-shadow: var(--ft-shadow);
}
.ft-photo--one {
background-image: url("https://images.unsplash.com/photo-1501785888041-af3ef285b470?auto=format&fit=crop&w=1200&q=82");
}
.ft-photo--two {
background-image: url("https://images.unsplash.com/photo-1447752875215-b2761acb3c5d?auto=format&fit=crop&w=1200&q=82");
}
.ft-photo--three {
background-image: url("https://images.unsplash.com/photo-1500534314209-a25ddb2bd429?auto=format&fit=crop&w=1200&q=82");
}
.ft-photo--four {
background-image: url("https://images.unsplash.com/photo-1470770903676-69b98201ea1c?auto=format&fit=crop&w=1200&q=82");
}
.ft-photo--five {
background-image: url("https://images.unsplash.com/photo-1433086966358-54859d0ed716?auto=format&fit=crop&w=1200&q=82");
}
.ft-photo--six {
background-image: url("https://images.unsplash.com/photo-1500534623283-312aade485b7?auto=format&fit=crop&w=1200&q=82");
}
.ft-page-hero {
width: min(1180px, calc(100% - 40px));
margin: 0 auto;
padding: 92px 0 58px;
}
.ft-page-hero p {
max-width: 760px;
font-size: 1.15rem;
}
.ft-page-hero--photo {
padding-bottom: 38px;
}
.ft-timeline {
display: grid;
gap: 14px;
}
.ft-timeline div {
display: grid;
grid-template-columns: 150px 1fr;
gap: 16px 26px;
background: var(--ft-white);
border: 1px solid var(--ft-line);
border-radius: 8px;
padding: 22px;
}
.ft-timeline span {
color: var(--ft-forest);
font-weight: 800;
}
.ft-timeline strong {
display: block;
font-size: 1.1rem;
}
.ft-cta {
margin-top: 48px;
margin-bottom: 84px;
padding: 42px;
border-radius: 8px;
background: linear-gradient(135deg, var(--ft-sky), var(--ft-sand));
}
.ft-contact {
display: grid;
gap: 20px;
padding: 0 0 88px;
}
@media (max-width: 900px) {
.ft-cards--three,
.ft-cards--two,
.ft-contact,
.ft-split,
.ft-gallery-preview,
.ft-photo-grid {
grid-template-columns: 1fr;
}
.ft-hero {
min-height: auto;
}
.ft-hero__content {
padding: 100px 0 76px;
}
.ft-timeline div {
grid-template-columns: 1fr;
}
.ft-photo {
min-height: 280px;
}
}
@media (max-width: 560px) {
.ft-site {
font-size: 16px;
}
.ft-site h1 {
font-size: 2.45rem;
}
.ft-band,
.ft-split,
.ft-page-hero {
padding-top: 58px;
padding-bottom: 48px;
}
.ft-card,
.ft-cta {
padding: 22px;
}
.ft-button {
width: 100%;
}
}
CSS
);
},
20
);
function ftech_is_arabic_request() {
$path = isset( $_SERVER['REQUEST_URI'] ) ? wp_parse_url( sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ), PHP_URL_PATH ) : '';
return is_string( $path ) && preg_match( '#^/ar(/|$)#', $path );
}
add_filter(
'body_class',
function ( $classes ) {
if ( ftech_is_arabic_request() ) {
$classes[] = 'ftech-ar';
}
return $classes;
}
);
add_filter(
'wp_nav_menu_args',
function ( $args ) {
if ( ! empty( $args['theme_location'] ) && 'primary' === $args['theme_location'] && ftech_is_arabic_request() ) {
$menu = wp_get_nav_menu_object( 'Primary Arabic' );
if ( $menu ) {
$args['menu'] = $menu->term_id;
}
}
return $args;
}
);
add_filter(
'wp_nav_menu_items',
function ( $items, $args ) {
if ( empty( $args->theme_location ) || 'primary' !== $args->theme_location ) {
return $items;
}
if ( ftech_is_arabic_request() ) {
$items .= '<li class="menu-item ftech-lang-switch"><a href="' . esc_url( home_url( '/' ) ) . '">English</a></li>';
} else {
$items .= '<li class="menu-item ftech-lang-switch"><a href="' . esc_url( home_url( '/ar/' ) ) . '">العربية</a></li>';
}
return $items;
},
10,
2
);
add_action(
'wp_body_open',
function () {
$is_arabic = ftech_is_arabic_request();
$url = $is_arabic ? home_url( '/' ) : home_url( '/ar/' );
$label = $is_arabic ? 'English' : 'العربية';
?>
<a class="ftech-floating-lang" href="<?php echo esc_url( $url ); ?>"><?php echo esc_html( $label ); ?></a>
<?php
}
);
add_action(
'wp_head',
function () {
?>
<style id="ftech-rtl-style">
.ftech-ar .ft-site,
.ftech-ar .entry-content {
direction: rtl;
text-align: right;
}
.ftech-ar .ft-checks li {
padding-left: 0;
padding-right: 28px;
}
.ftech-ar .ft-checks li::before {
left: auto;
right: 0;
}
.ftech-ar .ft-hero__media {
transform: scaleX(-1);
}
.ftech-ar .ft-hero__content,
.ftech-ar .ft-section-head,
.ftech-ar .ft-page-hero p {
margin-right: auto;
}
.ftech-lang-switch a {
font-weight: 800;
}
.ftech-floating-lang {
position: fixed;
right: 18px;
bottom: 18px;
z-index: 9999;
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 86px;
padding: 10px 14px;
border-radius: 999px;
background: #0f172a;
color: #fff;
font-size: 14px;
font-weight: 800;
line-height: 1;
text-decoration: none;
box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}
.ftech-floating-lang:hover,
.ftech-floating-lang:focus {
color: #fff;
background: #2563eb;
}
.ftech-ar .ftech-floating-lang {
right: auto;
left: 18px;
}
</style>
<?php
}
);