Skip to content

Instantly share code, notes, and snippets.

@jmabbas
jmabbas / functions.php
Last active March 20, 2026 05:32
Author image instead of title.
add_filter( 'get_the_archive_title', function( $title ) {
if ( is_author() ) {
$author_id = get_queried_object_id();
$output = '<div class="author-image" style="display:flex; justify-content:center; margin-bottom:20px;">';
$output .= get_avatar( $author_id, 150 );
$output .= '</div>';
@jmabbas
jmabbas / functions.php
Created March 17, 2026 10:10
Electro - Mobile load social icons after header row
function electro_handheld_header_v2() {
if ( has_electro_mobile_header() ) :
$classes = '';
if ( apply_filters( 'electro_handheld_header_v2_light_bg', false ) ) {
$classes = 'light';
}
?>
<div class="handheld-header-wrap container <?php echo esc_attr( electro_handheld_header_responsive_class() ); ?>">
<div class="handheld-header-v2 row align-items-center handheld-stick-this <?php echo esc_attr( $classes ); ?>">
<?php
@jmabbas
jmabbas / functions.php
Last active March 17, 2026 06:47
Electro - Custom changes
function electro_footer_social_icons_hh() { ?>
<div class="container">
<?php electro_footer_address(); ?>
</div>
<?php
}
@jmabbas
jmabbas / functions.php
Created March 16, 2026 10:14
Electro - Header icons with custom image
function electro_header_icons() {
?><div class="header-icons col-auto d-flex justify-content-end align-items-center">
<a href="YOUR_LINK"><img style="width: 20px; height: 20px;" src="IMAGE_URL" alt="IMAGE-NAME"></a>
<?php
do_action( 'electro_header_icons' ); ?></div>
<!-- /.header-icons --><?php
}
@jmabbas
jmabbas / functions.php
Created March 12, 2026 08:22
Electro - Department menu vertical scroll
add_action( 'wp_head', 'ec_child_department_menu_vertical_scroll', 10 );
function ec_child_department_menu_vertical_scroll() { ?>
<script>
document.addEventListener("DOMContentLoaded", function () {
const ul = document.getElementById("menu-all-departments-menu-1");
if (!ul) return;
const visibleCount = 10;
@jmabbas
jmabbas / style.css
Created March 9, 2026 07:19
Techmarket - Departments menu color
.page-template-template-homepage-v2 .header-v1 .departments-menu button {
color: #fff;
border-color: #0063d1;
background-color: #0063d1;
}
@jmabbas
jmabbas / login.php
Last active March 9, 2026 06:21
Geeks - Login / Register redirect
<?php
use TUTOR\Ajax;
$value_remember =false;
$wp_lostpassword_url = apply_filters( 'tutor_lostpassword_url', wp_lostpassword_url() );
$wp_lostpassword_label = esc_html__( 'Forgot Password?', 'geeks' );
$login_url = tutor_utils()->get_option('enable_tutor_native_login', null, true, true) ? '' : wp_login_url(tutor()->current_url);
?>
<div class="tutor-login-modal tutor-modal">
@jmabbas
jmabbas / style.css
Created March 9, 2026 05:36
Techmarket - Departments menu on hover
.site-header .departments-menu:hover ul#menu-departments-menu {
display: block;
top: 55%;
}
ul#menu-departments-menu {
display: none;
}
@jmabbas
jmabbas / functions.php
Last active March 20, 2026 07:28
Electro - Cart page custom
add_action( 'init', 'ec_child_cart_shipping_calculator_link', 10 );
function ec_child_cart_shipping_calculator_link() {
add_action( 'woocommerce_before_cart', 'custom_shipping_calculator_link', 8 );
add_action( 'woocommerce_before_shipping_calculator', 'custom_shipping_calculator_link_redirect', 8 );
}
function custom_shipping_calculator_link() {
?>
<a href="#shipping-calculator-form-redirect" class="custom-shipping-calculator-link" style="display: none; color: #ce2020; text-decoration: underline; justify-content: center;" aria-expanded="false" aria-controls="shipping-calculator-form" role="button">
@jmabbas
jmabbas / style.css
Created March 2, 2026 08:10
Electro - Custom Styles
@media (max-width:767px) {
.owl-item>.product .product-loop-body .product-rating,
.products>.product .product-loop-body .product-rating {
margin-bottom: 5px;
}
.owl-item>.product .add-to-cart-wrap,
.products>.product .add-to-cart-wrap {
margin-top: 5px;
}