Skip to content

Instantly share code, notes, and snippets.

View neverything's full-sized avatar

Silvan Hagen neverything

View GitHub Profile
@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(); ?>
@neverything
neverything / header.php
Created February 15, 2013 12:36
required+ Foundation: Custom header.php to always use the nav-top-bar.php as default navigation instead of nav.php.
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div class="container">
*
* @link http://themes.required.ch/news/getting-love-for-required-foundation-thank-you/#comment-2862
*/
?><!DOCTYPE html>
<?php if ( get_field( 'schede_prodotti' ) ): ?>
<table class="product-list simple-list">
<?php
$ids = array(); // Empty array for the $post->IDs from the relationship fields
$files = array(); // Empty array for the files from the repeater fields
while( has_sub_field( 'schede_prodotti' ) ):
/**