Skip to content

Instantly share code, notes, and snippets.

View ibndawood's full-sized avatar
💭
I may be slow to respond.

Kader Ibrahim S ibndawood

💭
I may be slow to respond.
View GitHub Profile
@ibndawood
ibndawood / functions.php
Last active September 23, 2015 03:35
Overriding bethlehem navigation links
<?php
function bethlehem_navigation_links() {
$header = bethlehem_get_header();
?>
<div class="top-nav-links">
<?php if( $header == 'header-7' ) : ?>
<ul>
<li class="events-link">
<a href="<?php echo esc_url( tribe_get_events_link() ); ?>"><i class="fa fa-calendar"></i><?php echo __( 'Calendar', 'bethlehem' ); ?></a>
</li>
@ibndawood
ibndawood / scripts.js
Created September 29, 2015 16:29
Prevent scrolling to top
$('body').on('added_to_cart', function(){
$('.product-item').unblock(); // Unblock the product item
$('.cart-item').unblock();
$('.compare-list').unblock();
$('html,body').animate({
scrollTop: $('.top-cart-holder').offset().top - 20
}, 1000, function(){
$('.top-cart-holder .dropdown-toggle').dropdown('toggle');
@ibndawood
ibndawood / functions.php
Created September 30, 2015 15:02
Shop By Departments menu
<?php
function media_center_department_nav_menu(){
$department_nav_menu = '';
$department_nav_menu .= '<ul class="dropdown-menu">';
$department_nav_menu .= wp_list_categories(
array(
'title_li' => '',
'hide_empty' => 1 ,
'taxonomy' => 'product_cat',
@ibndawood
ibndawood / functions.php
Created October 6, 2015 08:34
Adding Azerbaijani Manat
add_filter( 'woocommerce_currencies', 'add_my_currency' );
function add_my_currency( $currencies ) {
$currencies['ANZ'] = __( 'Azerbaijani manat', 'woocommerce' );
return $currencies;
}
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
function add_my_currency_symbol( $currency_symbol, $currency ) {
@ibndawood
ibndawood / functions.php
Created October 15, 2015 06:05
Changing the "Read More" text in Sportexx
<?php
add_filter( 'sportexx_blog_post_readmore_text', 'sx_child_change_readmore_text' );
function sx_child_change_readmore_text( $readmore ) {
return __( 'Your custom text for Read More', 'sportexx-child' );
}
@ibndawood
ibndawood / functions.php
Last active October 15, 2015 06:08
Changing "What are you looking for ?" text by overriding sportexx_navbar_right_search function
<?php
function sportexx_navbar_right_search() {
?>
<form role="search" class="form-search clearfix" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div class="input-group input-search-group">
<label class="sr-only" for="search-field"><?php _e( 'Type your Search', 'sportexx' ); ?></label>
<input id="search-field" value="<?php echo get_search_query(); ?>" name="s" type="text" class="input-search form-control" placeholder="<?php echo __( 'Your text ?', 'sportexx' ); ?>">
<span class="input-group-btn">
<button class="btn btn-search" type="submit"><i class="fa fa-search search-icon"></i><span class="sr-only"><?php echo __( 'Search', 'sportexx' ); ?></span></button>
@ibndawood
ibndawood / functions.php
Created October 20, 2015 06:43
Opening Footer Social Icons in new page
<?php
function sportexx_footer_social_icons() {
$social_icons_args = apply_filters( 'sportexx_footer_social_icons_args', array(
array(
'id' => 'facebook',
'title' => __( 'Facebook', 'sportexx' ),
'icon' => 'fa fa-facebook',
'link' => '#'
@ibndawood
ibndawood / functions.php
Created November 3, 2015 06:44
Adding Google Analytics code
<?php
add_action( 'wp_head', 'add_my_google_analytics_code', PHP_INT_MAX );
function add_my_google_analytics_code() {
?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
@ibndawood
ibndawood / functions.php
Created November 3, 2015 15:59
Removing 'ministries', 'sermons' and 'stories' in Bethlehem
remove_action( 'init', array( 'Ministries', 'init_ministries' ) );
remove_action( 'init', array( 'Sermons', 'init_sermons' ) );
remove_action( 'init', array( 'Stories', 'init_stories' ) );
@ibndawood
ibndawood / functions.php
Created November 3, 2015 16:04
Removing "Donate Now" button in Bethlehem header
function bethlehem_navigation_links() {
return;
}