Skip to content

Instantly share code, notes, and snippets.

/*--------------------------------------------------*/
/* remove byline from page */
/*--------------------------------------------------*/
function custom_body_class($classes) {
if (is_page()) {
$classes[] .= 'hide_meta';
}
return $classes;
@psteinweber
psteinweber / Auto click to tweet.css
Last active January 2, 2016 22:29
#twitter #jquery This jquery snipped appends a "Click to tweet" button (font-awesome icon in this case) into every blockquote on the page. Created as a replacement for bulky "Click to tweet" wordpress plugins.
blockquote a:before {
content:"\f099";
font-family: FontAwesome;
margin-left: 10px;
}
@psteinweber
psteinweber / Fade-in share buttons.css
Created January 13, 2014 08:56
This small gist allows creating "Share buttons" (or something else) which fade in and while the content is in the viewport.
.post-sharing-side {
position: fixed;
top: 50%;
right: 50%;
margin-right: -530px;
}
@psteinweber
psteinweber / wp-config.php
Last active January 3, 2016 16:09
#wordpress Set custom URL in wp-config.php (as described here: http://codex.wordpress.org/Changing_The_Site_URL#Edit_wp-config.php )
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
@psteinweber
psteinweber / wordpress-bloginfo-url.php
Created January 19, 2014 09:56
#wordpress bloginfo url link
<a href="<?php bloginfo( 'url' ); ?>/path" title="">
@psteinweber
psteinweber / functions.php
Last active January 3, 2016 18:29
#wordpress #thesis move nav below header
/* ==========================================================================
Move nav below header
========================================================================== */
remove_action('thesis_hook_before_header', 'thesis_nav_menu');
add_action('thesis_hook_after_header', 'thesis_nav_menu');
@psteinweber
psteinweber / functions.php
Last active January 3, 2016 18:29
#wordpress #thesis Custom header logo
/* ==========================================================================
Custom header logo
========================================================================== */
function custom_header() { ?>
<a href="/"><img src="/media/image.jpg" alt="alt text"></a>
<?php
}
remove_action('thesis_hook_header', 'thesis_default_header');
@psteinweber
psteinweber / Font Awesome checkbox.css
Last active January 4, 2016 02:39
#fontawesome checkboxes
label {
font-weight: 400;
}
label p {
margin-top: -40px;
margin-left: 40px;
}
input[type="checkbox"] {
@psteinweber
psteinweber / Detect android.js
Last active August 29, 2015 13:56
Remove a class on devices > Android 2.3 #js #android
var ua = navigator.userAgent;
if( ua.indexOf("Android") >= 0 )
{
var androidversion = parseFloat(ua.slice(ua.indexOf("Android")+8));
if (androidversion < 2.3)
{
$('.class').css('display','none');
}
}
@psteinweber
psteinweber / Register image sizes.php
Last active August 29, 2015 13:56
Register custom images sizes in wordpress functions.php and make them accessible via the media manager. #wordpress #php
/* ==========================================================================
Register image sizes
========================================================================== */
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'blog-featured', 940, 330, true ); // cropped
add_image_size( 'testimonial-thumb', 100, 100, false ); // not cropped
}