Skip to content

Instantly share code, notes, and snippets.

View neocreo's full-sized avatar

Daniel Hansson neocreo

View GitHub Profile
@neocreo
neocreo / gist:5054548
Created February 28, 2013 05:54
HTML: favicon-link
<link rel="shortcut icon" type="image/x-icon" href="//static.getmyo.com/img/favicon.ico" />
<link rel="apple-touch-icon" href="//static.getmyo.com/img/apple-touch-icon.png" />
<link rel="apple-touch-icon-precomposed" href="//static.getmyo.com/img/apple-touch-icon.png" />
<link rel="apple-touch-icon-precomposed" href="//static.getmyo.com/img/apple-touch-icon-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="//static.getmyo.com/img/apple-touch-icon-57x57-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="//static.getmyo.com/img/apple-touch-icon-72x72-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="//static.getmyo.com/img/apple-touch-icon-114x114-precomposed.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="//static.getmyo.com/img/apple-touch-icon-144x144-precomposed.png" />
@neocreo
neocreo / part-list-latest.php
Created March 6, 2013 10:00
WP: list latest from custom post types
<?php //list 3 latest of all content ?>
<aside id="list_latest">
<?php //Activities ?>
<h2><?php _e( 'Latest Activities', 'bonestheme' ); ?></h2>
<?php $posts = new WP_Query(array(
'post_type' => 'neo_activities',
// 'category_name' => 'arbetsprover',
'posts_per_page' => 3
)); ?>
<ul class="image-list vertical">
@neocreo
neocreo / custom-post-type-sorting.php
Created March 14, 2013 16:15
WP: Custom Post Type Sorting
//Let's add sortability and special kolumns
// Change the columns for the edit CPT screen
function change_columns( $cols ) {
$cols = array(
'cb' => '<input type="checkbox" />',
'order' => __( 'Order', 'bonestheme' ),
'title' => __( 'Title', 'bonestheme' ),
'date' => __( 'Date', 'bonestheme' ),
'author' => __( 'Author', 'bonestheme' ),
// 'url' => __( 'URL', 'trans' ),
@neocreo
neocreo / jQuery: Find taxanomy
Created June 4, 2013 07:24
jQuery: Find taxanomy
/*works only for separate submenu*/
/*var subnavID = $('.nav_sub ul').attr('id');
switch ( subnavID ){
case 'activity-cats':
$('nav li a[href$="/activity"]').parent('li').addClass('current-page-ancestor');
break;
case 'place-cats':
$('nav li a[href$="/place"]').parent('li').addClass('current-page-ancestor');
break;
@neocreo
neocreo / SEO Rewrite
Created January 16, 2015 10:45
SEO Rewrite for IIS webconfig
<rewrite>
<rules>
<rule name="WordPress Rule" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
@neocreo
neocreo / gist:02aed67fdce84339a4a5
Last active August 29, 2015 14:19
Center anything vertically AND horisontally in CSS
.parent-element {
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.element {
position: relative;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%,-50%);