Skip to content

Instantly share code, notes, and snippets.

@About2git
About2git / gist:4772497
Created February 12, 2013 19:16
CSS: ul bulletpoint with sprited Image
ul li{
margin-bottom: 10px;
padding-left:10px;
}
ul li:before{
background:url("img/spriteNAME.png") no-repeat XXpx XXpx;
width:XXpx;
height:XXpx;
@About2git
About2git / CSS: Hide text for Screenreaders or hide visually but not for screenreaders
Last active December 13, 2015 17:18
CSS: Hide text for Screenreaders or hide visually but not for screenreaders
/* Hide for all Screenreaders http://www.456bereastreet.com/archive/200711/screen_readers_sometimes_ignore_displaynone/ */
.hidden {
display:none;
visibility:hidden;
}
/* Hide visually but read in Screenreaders http://webaim.org/techniques/css/invisiblecontent/ */
.screen-reader-text {
position:absolute;
left:-10000px;
@About2git
About2git / gist:5371317
Created April 12, 2013 11:14
CSS: Google CSE, Searchbox Styling for Drupal, rounded Corners
/**
* Google CSE
*/
.block-search-form{
float: right;
}
.form-item-search-block-form{
width:auto;
}
.google-cse{
@About2git
About2git / Drupal: Replace jQuery UI Theme Function in template.php
Created May 2, 2013 13:23
Drupal: Replace jQuery UI Theme Function in template.php
/**
* implements hook_css_alter()
*/
function YOURTHEMENAME_css_alter(&$css) {
// Installs the jquery.ui themeroller theme to the theme.
if (isset($css['misc/ui/jquery.ui.theme.css'])) {
$css['misc/ui/jquery.ui.theme.css']['data'] = drupal_get_path('theme', 'YOURTHEMENAME') . '/css/jquery-ui.custom.min.css';
}
}
@About2git
About2git / Kirby: Teaser Image from Article, PHP
Created July 5, 2013 09:18
Kirby: Teaser Image from article
// http://getkirby.com/forum/how-to/topic:665
<img src="<?php echo $article->images()->find(html($article->featuredimg()))->url() ?>" width="" height="" />
@About2git
About2git / Drupal: Add JS (Javascript) only to Frontpage via template.php function hook
Created July 8, 2013 18:53
Drupal: add JS (Javascript) only on Frontpage via template.php function hook
function YOURTHEMENAME_preprocess_page(&$vars, $hook)
{
// jQuery - diese Scripte fuer alle Seiten einbinden
drupal_add_js(drupal_get_path('theme', 'YOURTHEMENAME') . '/js/sidewide.js', array('scope' => 'footer', 'weight' => 80));
// jQuery - diese Scripte nur auf Startseite einbinden
if ($vars['is_front']) {
drupal_add_js(drupal_get_path('theme', 'YOURTHEMENAME') . '/js/plugin.js');
drupal_add_js(drupal_get_path('theme', 'YOURTHEMENAME') . '/js/script.js', array('scope' => 'footer', 'weight' => 99));
}
@About2git
About2git / Kirby: dynamically give every page an unique body class, css
Created July 15, 2013 15:10
Kirby: dynamically give every page an unique body class, css
<body class="<?php echo $page->uid() ?>">
@About2git
About2git / Kirby Semantic Breadcrumb based on WordPress Seo
Last active August 29, 2015 14:10
Snippet for building a breadcrumb in www.getkirby.com with semantic markup (schema.org)
<div class="breadcrumb" itemprop="breadcrumb">
You are here:
<span prefix="v: http://rdf.data-vocabulary.org/#">
<?php foreach($site->breadcrumb() AS $crumb): ?>
<?php if ($crumb->isActive()): ?>
<span typeof="v:Breadcrumb">
<span class="breadcrumb_last" property="v:title">
<?php echo $crumb->title() ?>
</span>
</span>

sitemap.xml for Kirby CMS

Notes:

  • Remember to exclude the sitemap from caching, search and the sitemap itself!
    • and exclude only the pages you don`t wnt wto exclude
@About2git
About2git / functions.php
Last active August 29, 2015 14:15 — forked from srikat/functions.php
How to display only the Title and Featured Image for Posts in Genesis.
<?php
//* Do NOT include the opening php tag
/**
* Featured Image linking to Post's single page.
*/
function sk_do_post_image() {
$image_args = array(
'size' => 'full',
'attr' => array(