Skip to content

Instantly share code, notes, and snippets.

View neverything's full-sized avatar
🍀
Good vibes for you

Silvan Hagen neverything

🍀
Good vibes for you
View GitHub Profile
@neverything
neverything / plugin.php
Last active October 11, 2015 18:48
Nasty fix to pass fixed cookie value in WP_Http_Cookie
<?php
//...
// Replace space with + from cookie value
// because WP_Http_Cookie does urldecode( value )
// which is fucking wrong.
$response['cookies'][0]->value = str_replace(' ', '+', $response['cookies'][0]->value);
// Set cookies for the second request
$this->cookies = $response['cookies'];
//...
<?php
if ( function_exists( 'required_side_nav' ) ) {
$args = array(
'before' => '<ul class="tabs vertical">',
'after' => '</ul>',
);
required_side_nav( $args );
}
@neverything
neverything / front-page.php
Created November 24, 2012 14:51
required+ Foundation WordPress front page template
<?php
/**
* Custom front-page.php template
*
* Used to display the homepage of your
* WordPress site.
*
* @link http://themes.required.ch/?p=606
*/
@neverything
neverything / content-page.php
Created November 30, 2012 14:54
required+ Foundation WordPress template structure
<?php
/**
* The template used for displaying page content in page.php
*
* Example version to show how we overwrite the content output
* on a page in your child theme
*
* @link http://themes.required.ch/?p=755
*/
?>
@neverything
neverything / functions-snippet-1.php
Created December 13, 2012 15:09
required+ Foundation - How scripts and styles are loaded in WordPress
<?php
// Add the following line to your required_starter_themesetup in your child theme functions.php
remove_action( 'wp_enqueue_scripts', 'required_load_scripts' );
@neverything
neverything / functions.php
Created January 14, 2013 16:00
Fixes admin bar issues with the Foundation Top Bar
<?php
add_action('wp_head', 'admin_bar_fix', 5);
function admin_bar_fix() {
if( !is_admin() && is_admin_bar_showing() ) {
remove_action( 'wp_head', '_admin_bar_bump_cb' );
$output = '<style type="text/css">'."\n\t";
//$output .= 'body.admin-bar { padding-top: 28px; }'."\n";
$output .= 'body.admin-bar .top-bar { margin-top: 28px; }'."\n";
/**
* Here goes all the JS Code you need in your child theme buddy!
*/
(function($) {
$('.percentage').easyPieChart({
animate: 1000
});
$('.percentage-light').easyPieChart({
@neverything
neverything / child-theme.js
Last active December 11, 2015 18:28
Render a page from the main navigation as a Reveal window in your required+ Foundation child theme.
/**
* Here goes all the JS Code you need in your child theme buddy!
*/
(function($) {
// Find the ID on the menu item you want reveal to open with
$("#menu-item-342").click( function( event ) {
event.preventDefault();
// The ID of our freshly creafted modal window content
$("#page-to-modal-317").reveal();
@neverything
neverything / index.php
Created February 7, 2013 13:37
Sample index.php file to show how you could create a new row after two posts.
<?php
/**
* Sample index.php file for displaying two posts per row
*/
get_header(); ?>
<!-- Row for main content area -->
<div id="content" class="row">
@neverything
neverything / off-canvas-page.php
Created February 9, 2013 16:50
Custom Off Canvas page template for required+ Foundation creating a Vertical Nav-Bar according to ZURB Foundation.
<?php
/**
* Template Name: Off Canvas Page Template
* Description: A Page Template with a subnavigation on the left side
*
* @link https://github.com/wearerequired/required-foundation/issues/17
*/
get_header(); ?>