Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
farookibrahim / functions.php
Created January 29, 2016 07:36
Social Media Links Open in New Tab
if ( ! function_exists( 'bethlehem_social_icons' ) ) {
/**
* Display social icons
* If the subscribe and connect plugin is active, display the icons.
* @link http://wordpress.org/plugins/subscribe-and-connect/
* @since 1.0.0
*/
function bethlehem_social_icons() {
$social_icons_args = apply_filters( 'bethlehem_social_icons_args', array(
@farookibrahim
farookibrahim / functions.php
Created February 1, 2016 06:16
Bethlehem Blog Archive Button Text Change
add_filter( 'blog_archive_link_text', 'custom_blog_archive_link_text' );
function custom_blog_archive_link_text() {
return esc_html__( 'Text', 'bethlehem' );
}
@farookibrahim
farookibrahim / functions.php
Created February 4, 2016 05:24
Replace Search bar for Nav links in Bethlehem Header 3
// Use init to perform remove_action on child theme
add_action( 'init', 'bethlehem_child_init', 10 );
function bethlehem_child_init() {
// remove nav links on header
remove_action( 'bethlehem_header_3_nav_bar', 'bethlehem_navigation_links', 20 );
}
// To add search block
add_action( 'bethlehem_header_3_nav_bar', 'custom_header_search_block', 20 );
function custom_header_search_block() {
@farookibrahim
farookibrahim / functions.php
Created February 5, 2016 06:37
Replace Search bar as dropdown for Nav links in Bethlehem Header 3
add_action( 'init', 'bethlehem_child_init', 10 );
function bethlehem_child_init() {
// remove nav links on header
remove_action( 'bethlehem_header_3_nav_bar', 'bethlehem_navigation_links', 20 );
}
if ( ! function_exists( 'bethlehem_primary_navigation' ) ) {
/**
* Display Primary Navigation
* @since 1.0.0
@farookibrahim
farookibrahim / functions.php
Created February 9, 2016 08:55
Bethlehem Header Navigation Links Customize
add_filter( 'bethlehem_header_navbar_link_args', 'bethlehem_child_header_navbar_link_args' );
if( ! function_exists( 'bethlehem_child_header_navbar_link_args' ) ) {
function bethlehem_child_header_navbar_link_args( $args ) {
$args = array(
array(
'title' => esc_html__( 'Calendar', 'bethlehem' ),
'link' => tribe_get_events_link(),
'icon' => 'fa fa-calendar',
'class' => 'events-link',
@farookibrahim
farookibrahim / functions.php
Last active February 10, 2016 14:43
Unicase Custom Header Info Content
add_filter( 'unicase_header_contact_info', 'custom_apply_header_contact_info', 20 );
function custom_apply_header_contact_info( $info ) {
global $unicase_options;
if ( !empty( $unicase_options['header_support_phone'] ) || !empty( $unicase_options['header_support_email'] ) ) :
ob_start();
?>
<div class="contact-row">
<?php if( !empty( $unicase_options['header_support_phone'] ) ) : ?>
<div class="phone inline">
@farookibrahim
farookibrahim / functions.php
Last active February 16, 2016 06:49
Unicase add banner in before shop page
add_action( 'woocommerce_before_main_content', 'custom_banner_html' );
function custom_banner_html() {
?>
<div class="row inner-bottom-xs">
<div class="col-md-4">
<img src="">
</div>
<div class="col-md-4">
<img src="">
</div>
@farookibrahim
farookibrahim / functions.php
Created February 25, 2016 05:19
Bethlehem Remove Comments Display
add_action( 'init', 'bethlehem_child_init', 10 );
function bethlehem_child_init() {
// remove nav links on header
remove_action( 'bethlehem_page_after', 'bethlehem_display_comments', 10 );
remove_action( 'bethlehem_single_post_after', 'bethlehem_display_comments', 10 );
}
@farookibrahim
farookibrahim / archive-sport.php
Created February 25, 2016 14:54
Unicase CPT sport loop template
<?php
get_header();
ob_start();
if( have_posts() ) {
get_template_part( 'loop' );
@farookibrahim
farookibrahim / single-sport.php
Created February 25, 2016 14:55
Unicase CPT sport single template
<?php
get_header();
ob_start();
while ( have_posts() ) : the_post();
do_action( 'unicase_single_post_before' );