Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
farookibrahim / style.css
Created July 18, 2016 11:40
MyBag Add Background image for Header v2
header.site-header.header-2 {
background-image: url('http://example.com/wp-content/uploads/2016/04/bg.jpg');
background-position: center center;
background-size: cover;
background-repeat: no-repeat
}
.page-template-template-homepage.home.home-v2 header.site-header.header-2,
.page-template-template-homepage.home.home-v2 header.site-header.header-2,
.home.home-v2 header.site-header.header-2 {
@farookibrahim
farookibrahim / functions.php
Created August 16, 2016 07:39
Unicase Out of Stock label
add_action( 'woocommerce_before_shop_loop_item_title', 'uc_wc_template_loop_stock', 11 );
function uc_wc_template_loop_stock() {
global $product;
if ( ! $product->managing_stock() && ! $product->is_in_stock() ) {
echo '<div class="ribbon label-out-of-stock"><span>Out of Stock</span></div>';
}
}
@farookibrahim
farookibrahim / functions.php
Last active August 16, 2016 09:26
Unicase Child Style Enqueue with RTL
function uc_child_enqueue_styles() {
global $unicase_version;
wp_enqueue_style( 'unicase-style', get_template_directory_uri() . '/rtl.css', '', $unicase_version );
wp_enqueue_style( 'unicase-child-style', get_stylesheet_directory_uri() . '/style.css', array( 'unicase-style' ) );
}
add_action( 'wp_enqueue_scripts', 'uc_child_enqueue_styles' );
@farookibrahim
farookibrahim / functions.php
Created August 18, 2016 14:35
Electro Product Categories Widget Custom Args
add_filter( 'electro_product_categories_widget_args', 'custom_electro_product_categories_widget_args' );
function custom_electro_product_categories_widget_args( $args ) {
$args['orderby'] = 'name';
return $args;
}
@farookibrahim
farookibrahim / functions.php
Last active February 5, 2019 19:22
Electro Departments Menu Hover Click Redirect
add_filter( 'electro_departments-menu_dropdown_trigger', 'electro_departments_menu_dropdown_trigger', 10, 2 );
if ( ! function_exists( 'electro_departments_menu_dropdown_trigger' ) ) {
function electro_departments_menu_dropdown_trigger( $trigger, $theme_location ) {
return 'hover';
}
}
@farookibrahim
farookibrahim / functions.php
Created October 6, 2016 13:52
Unicase LiveSearch Product Count Increase
add_filter( 'unicase_live_search_query_args', 'custom_unicase_live_search_query_args' );
function custom_unicase_live_search_query_args( $args ) {
$args['posts_per_page'] = 20;
return $args;
}
@farookibrahim
farookibrahim / functions.php
Created October 7, 2016 15:28
Sermons Posttype Custom Args(Sermons changed to Radio)
add_filter( 'sermons_post_type_args', 'custom_sermons_post_type_args' );
function custom_sermons_post_type_args( $args ) {
$args = array(
'labels' => array(
'name' => _x( 'Radios', 'post type general name', 'bethlehem' ),
'singular_name' => _x( 'Radio', 'post type singular name', 'bethlehem' ),
'add_new' => _x( 'Add New', 'block', 'bethlehem' ),
'add_new_item' => __( 'Add New', 'bethlehem' ),
'edit_item' => __( 'Edit', 'bethlehem' ),
@farookibrahim
farookibrahim / functions.php
Last active October 18, 2016 13:00
Change Sermons Labels in Bethlehem
add_filter( 'sermons_post_type_labels', 'custom_sermons_post_type_labels' );
function custom_sermons_post_type_labels( $args ) {
$args = array(
'name' => _x( 'Sermons', 'post type general name', 'bethlehem' ),
'singular_name' => _x( 'Sermon', 'post type singular name', 'bethlehem' ),
'add_new' => _x( 'Add New', 'block', 'bethlehem' ),
'add_new_item' => __( 'Add New', 'bethlehem' ),
'edit_item' => __( 'Edit', 'bethlehem' ),
'new_item' => __( 'New', 'bethlehem' ),
@farookibrahim
farookibrahim / blog-element.php
Created October 19, 2016 15:35
MyBag Home Blog Element Customize
<?php
/**
* Blog Carousel
*
* @author Transvelo
* @package MyBag/Templates
* @version 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@farookibrahim
farookibrahim / functions.php
Created November 14, 2016 07:18
Bewear Header Social Links
if ( ! function_exists( 'bewear_header_social_link' ) ) {
/**
* Displays a link to social profile in website header
*
*/
function bewear_header_social_link() {
$social_networks = apply_filters( 'bewear_set_social_networks', bewear_get_social_networks() );
$social_links_output = '';
$social_link_html = apply_filters( 'bewear_header_social_link_html', '<a class="%1$s" href="%2$s"></a>' );