Skip to content

Instantly share code, notes, and snippets.

View crumina's full-sized avatar
🎯
Focusing

crumina

🎯
Focusing
View GitHub Profile
@crumina
crumina / deploy.php
Created February 26, 2013 14:36
test
<?php
// Turn off error reporting
error_reporting(0);
try
{
// Decode the payload json string
$payload = json_decode($_REQUEST['payload']);
}
@crumina
crumina / tags in excerpt.php
Created August 10, 2013 16:19
Make wordpress excerpt to accept HTML tags
function custom_wp_trim_excerpt($text) {
$raw_excerpt = $text;
if ( '' == $text ) {
$text = get_the_content('');
$text = strip_shortcodes( $text );
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]&gt;', $text);
@crumina
crumina / gist:6496278
Created September 9, 2013 14:22
Siteorigin widget gallery fix
class SiteOrigin_Panels_Widgets_Gallery extends WP_Widget {
function __construct() {
parent::__construct(
'siteorigin-panels-gallery',
__( 'Gallery (PB)', 'so-panels' ),
array(
'description' => __( 'Displays a gallery.', 'so-panels' ),
)
);
}
<?php
/**
* Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
* @author Weston Ruter (@westonruter), X-Team
*/
add_action( 'init', array( 'XTeam_Nav_Menu_Item_Custom_Fields', 'setup' ) );
class XTeam_Nav_Menu_Item_Custom_Fields {
static $options = array(
<?php
/**
* Dimox Breadcrumbs
* http://dimox.net/wordpress-breadcrumbs-without-a-plugin/
* Since ver 1.0
* Add this to any template file by calling dimox_breadcrumbs()
* Changes: MC added taxonomy support
*/
function dimox_breadcrumbs(){
/* === OPTIONS === */
<?php
/* -------------------------------------------------------
You can add your custom functions below
-------------------------------------------------------- */
function custom_stunning_header() {
global $crum_theme_option;
$custom_st_header = get_post_meta(get_the_ID(),'single_post_st_header',true);
@crumina
crumina / gist:b59f5a7804fa6135951a
Last active August 29, 2015 14:14
Change url on logo [Onetouch2, Atlantis, Emabrace, Karat]
function custom_url_logo(){
$logo = reactor_option( 'custom_logo_media', get_template_directory_uri() . '/library/img/logo.png' );
$logo2x = reactor_option( 'custom_logo_retina', get_template_directory_uri() . '/library/img/logo@2x.png' );
if ( $logo['url'] || $logo2x['url'] ) : ?>
<div class="logo large-2 medium-2 columns">
<a href="<?php echo esc_url('http:Your custom URL HERE'); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img data-interchange='[<?php echo $logo['url']; ?>, (default)], [<?php echo $logo2x['url']; ?>, (retina)]' alt="" class="hideie">
@crumina
crumina / OneTouch top bar
Created January 30, 2015 13:38
aditional top bar + 2 menus for OneTouch
register_nav_menu('top-bar-l', __( 'Top Bar Left', 'reactor'));
register_nav_menu('top-bar-r', __( 'Top Bar Right', 'reactor'));
/**
* Top bar left menu
*
* @since 1.0.0
* @see wp_nav_menu
* @param array $locations Associative array of menu location identifiers (like a slug) and descriptive text.
@crumina
crumina / category.php
Last active August 29, 2015 14:14
Show Category as grid - [Onetouch]
<?php
/**
* The template for displaying posts by category
*
* @package Reactor
* @subpackge Templates
* @since 1.0.0
*/
?>
@crumina
crumina / Onetouch title change
Created February 17, 2015 07:59
Change title in head [ONETOUCH]
function cr_custom_do_reactor_head()
{
global $one_touch_option; ?>
<meta charset="utf-8"/>
<title><?php wp_title(); ?></title>
<!-- google chrome frame for ie -->
<!--[if IE]><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->