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 / 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' ) ):
/**
@neverything
neverything / functions.php
Last active December 10, 2023 02:22
WordPress: pre_get_posts filter to display one post per category. Displays the latest sticky post and therefore excludes the category of the sticky post as we only want one post per category.
<?php
/**
* Main Query for the Front Page
*
* Display the latest post per category. The latest sticky post goes to the
* top. It's category is then excluded as we only want 1 post per category.
*
* @param object $query WP_Query
*/
function sh_pre_get_posts_front_page( $query ) {
@neverything
neverything / .htaccess
Last active April 2, 2022 07:49
WordPress behind a reverse proxy.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /blog/
RewriteBase /~accountname/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /blog/index.php [L]
RewriteRule . /~accountname/index.php [L]
@neverything
neverything / vhost
Created December 6, 2013 15:52 — forked from gistwebdev/vhost
#!/bin/bash
#
# Display usage info
vhost-usage() {
cat <<"USAGE"
Usage: vhost [OPTIONS] <name>
-h|--help this screen
-pub to create the webhost root in ~/www/name/public/
-url to specify a local address, default is http://name.local
@neverything
neverything / template
Last active December 30, 2015 12:09 — forked from gistwebdev/template
<VirtualHost *:80>
ServerAdmin template.email
DocumentRoot template.webroot
ServerName template.url
ErrorLog "/private/var/log/apache2/template.name-error_log"
CustomLog "/private/var/log/apache2/template.name-access_log" common
<Directory template.webroot>
Options Includes FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
@neverything
neverything / functions.php
Created March 29, 2014 22:01
Overwrite or extend tiny mce styles dropdown in required-starter child theme.
<?php
/**
* Change options in the TinyMCE Styles dropdown
* @param array $args default styles array as seen in req-mce.php
* @return array our custom styles for the dropdown
*/
function req_starter_editor_stlye_args_filter( $args ) {
$custom_args = array(
@neverything
neverything / functions.php
Created March 29, 2014 22:09
Remove parent theme page templates in child theme from required-foundation theme
<?php
/**
* Remove parent theme Page Templates
*/
$_templates_to_remove = array();
function remove_template( $files_to_delete = array() ){
global $_templates_to_remove;

How to not get lost when entering Switzerland

Compiled by the #wcch team for @Rarst ;-)

Arrival at Zurich Airport

You will arrive at Zurich Airport (ZRH) and after you get your luggage and immigration is done, you'll finally be in Switzerland. Congrats and welcome!

The train station aka Zürich Flughafen

Luckily for you, the train station is inside the airport (downstairs). Just follow the signage that looks like this:

Pikto Bahn