Skip to content

Instantly share code, notes, and snippets.

@CoralSilver
CoralSilver / WP_Excerpts_ReadMore.php
Last active August 29, 2015 13:57
Add "Read More" link to WordPress manual and automatic excerpts
function custom_excerpt($text) { // custom 'read more' link
if (strpos($text, '[...]')) {
$excerpt = strip_tags(str_replace('[...]', '... <a href="'.get_permalink().'">read more...</a>', $text), "<a>");
} else {
$excerpt = '<p>' . $text . '&nbsp;&nbsp;<a href="'.get_permalink().'">read more...</a></p>';
}
return $excerpt;
}
add_filter('the_excerpt', 'custom_excerpt');
?>
@CoralSilver
CoralSilver / WP_codex_readMore
Created March 29, 2014 22:29
Snippet from Wordpress Codex to make excerpts display "read more"
function excerpt_read_more_link($output) {
global $post;
return $output . '<a href="'. get_permalink($post->ID) . '"> Read More...</a>';
}
add_filter('the_excerpt', 'excerpt_read_more_link');
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 46.7%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#428bca",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
@CoralSilver
CoralSilver / custom-select.css
Last active August 29, 2015 14:07
Custom Selects CSS (Hiding arrow on Firefox) (Absolutely positioned wrapper with FA icon)
@font-face{
font-family:FontAwesome;
src:url(https://netdna.bootstrapcdn.com/font-awesome/2.0/font//fontawesome-webfont.eot?#iefix) format('eot'),
url(https://netdna.bootstrapcdn.com/font-awesome/2.0/font//fontawesome-webfont.woff) format('woff'),
url(https://netdna.bootstrapcdn.com/font-awesome/2.0/font//fontawesome-webfont.ttf) format('truetype'),
url(https://netdna.bootstrapcdn.com/font-awesome/2.0/font//fontawesome-webfont.svg#FontAwesome) format('svg');
font-weight:400;font-style:normal;}
.select-wrapper {
font-family: Arial, sans-serif;
@CoralSilver
CoralSilver / custom-select.css
Last active August 29, 2015 14:08
Custom Selects CSS (Hiding arrow on Firefox) (Relatively positioned wrapper with data image background arrows)
.select-wrapper {
float: left; /*or right*/
position: relative;
}
select {
border: 1px solid #ccc;
height: 26px;
line-height: 18px;
margin: 0;
@CoralSilver
CoralSilver / image-replacement.css
Last active August 29, 2015 14:10
Responsive CSS logo image replacement with <a> tag
.logo {
height: 80px;
width: 100%;
max-width: 290px;
}
/*Using Scott Kellum CSS image replacement technique and based on this tut: http://tutvid.com/webdesign/css-tutorial-image-replacementlink-logo-to-homepage/*/
.logo-image {
display: block;
background: url(../imgs/logo.png) no-repeat;
@CoralSilver
CoralSilver / preload.js
Last active August 29, 2015 14:11
Jquery image preloader
$.preloadImages = function() {
for (var i = 0; i < arguments.length; i++) {
$("<img />").attr("src", arguments[i]);
}
}
$.preloadImages([
"hoverimage1.jpg",
"hoverimage2.jpg"
]);
@CoralSilver
CoralSilver / closure.js
Last active March 12, 2017 03:09
Increment function using closure
function makeIncrementer(x) {
return function() {
return x++;
};
}
var increment = makeIncrementer(0);
console.log(increment()); //0
console.log(increment()); //1
.button {
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
-o-appearance: none;
appearance: none;
background-color: #C85300;
border-radius: 4px;
border: none;
color: #fff;