Skip to content

Instantly share code, notes, and snippets.

View crumina's full-sized avatar
🎯
Focusing

crumina

🎯
Focusing
View GitHub Profile
@crumina
crumina / functions.php
Last active September 11, 2015 11:10
Replace related posts for wp under post
function crum_replace_related_posts(){
add_filter( 'rp4wp_append_content', '__return_false' );
add_action( 'reactor_post_after', 'rp4wp_children', 1 );
}
add_action( 'init', 'crum_replace_related_posts' );
@crumina
crumina / functions.php
Created September 11, 2015 09:45
[Embrace] WPML - default language switcher
if ( ! function_exists( 'reactor_toplang_r' ) ) {
function reactor_toplang_r( $args = '' ) {
if ( function_exists( 'icl_get_languages' ) ) {
$defaults = array(
'side' => 'right',
);
$args = wp_parse_args( $args, $defaults );
$args = apply_filters( 'reactor_top_bar_args', $args );
@crumina
crumina / functions.php
Last active September 30, 2015 10:49
[Embrace - menu align change]
add_action( 'wp_enqueue_scripts', 'embrace_custom_scripts', 100 );
function embrace_custom_scripts()
{
wp_dequeue_script( 'reactor-js' );
wp_deregister_script( 'reactor-js' );
// Now the parent script is completely removed
/*
* Now enqueue you child js file, no need to register if you are not
* doing conditional loading
@crumina
crumina / jquery-bootstrap-datepicker.css
Last active August 29, 2015 14:26 — forked from miwahall/jquery-bootstrap-datepicker.css
jQuery UI Datepicker Bootstrap 3 Style
.ui-datepicker {
background-color: #fff;
border: 1px solid #66AFE9;
border-radius: 4px;
box-shadow: 0 0 8px rgba(102,175,233,.6);
display: none;
margin-top: 4px;
padding: 10px;
width: 240px;
}
@crumina
crumina / functions.php
Created May 16, 2015 10:34
[Onetouch] Add custom shortcode after header on all pages
/**
* Custom shortcode on all pages
* in header.php
*
* @since 1.0.0
*/
function shortcode_after_header ()
{
@crumina
crumina / functions.php
Last active August 29, 2015 14:21
[Onetouch] Stunning header on page template "For Metro Visual builder"
/**
* Stunning header
* in header.php
*
* @since 1.0.0
*/
function frontpage_st_header ()
{
if (is_page_template('page-templates/fullwidth-page.php') ):
@crumina
crumina / custom.js
Created April 25, 2015 08:26
Enable accordion deeplinking for Foundation 5
jQuery(document).ready(function () {
setTimeout(function() {
if (window.location.hash) {
jQuery('.accordion dd > a').each(function () {
var current = jQuery(this).parents('.accordion');
var hash = '#' + jQuery(this).attr('href').split('#')[1];
if (hash == window.location.hash) {
current.find('dd').removeClass('active');
current.find('.content').hide();
jQuery(this).parent().addClass('active');
@crumina
crumina / functions.php
Created April 15, 2015 07:14
[Embrace] add tabs to woocommerce
<?php
// Unhook default Crumina functions
function unhook_crumina_functions() {
remove_filter( 'woocommerce_product_tabs', 'crum_remove_product_tabs', 98 );
}
add_action( 'init', 'unhook_crumina_functions' );
@crumina
crumina / functions.php
Created April 13, 2015 13:26
remove meta from post
<?php
function _remove_meta_from_posts() {
remove_action('reactor_post_header', 'reactor_do_post_header_meta', 3);
}
add_action( 'init', '_remove_meta_from_posts', 1 );
@crumina
crumina / functions.php
Last active August 29, 2015 14:18
[Onetouch] Modify post title
<?php
function cr_custom_header_titles() {
if ( is_single() ) { ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php if ( function_exists( 'the_ratings' ) ) {
the_ratings();
}
} else { ?>