Skip to content

Instantly share code, notes, and snippets.

View outsmart's full-sized avatar

Paul Ballardin outsmart

View GitHub Profile
@outsmart
outsmart / gist:43505893d4dc1d7ed07b
Created January 31, 2016 23:17
Add Customer Share Buttons with bootstrap
// from here http://petragregorova.com/articles/social-share-buttons-with-custom-icons/
<div class="share-wrapper">
<button class="btn btn-default share-toggle alignright" data-toggle="popover">share <i class="glyphicon glyphicon-chevron-down" aria-hidden="true"></i></button>
<div class="popper-content hide">
<?php
$url = get_site_url() . '/' .get_the_permalink() ;
$title = get_the_title();
$source = 'www.relPro.com';
$(document).ready(function() {
// run test on initial page load
checkSize();
// run test on resize of the window
$(window).resize(checkSize);
});
//Function to the css rule
function checkSize(){
@outsmart
outsmart / gist:f481fb49d5516389d864
Created January 28, 2016 05:14
Customise Next Post Previous Post links in Wordpress
add_filter('next_post_link', 'post_link_attributes');
add_filter('previous_post_link', 'post_link_attributes');
function post_link_attributes($output) {
$code = 'class="styled-button"';
return str_replace('<a href=', '<a '.$code.' href=', $output);
}
@outsmart
outsmart / gist:d4a9005e87dd9a8a6f65
Created January 27, 2016 12:46
Wordpress Post Thumbnail In Loop
if ( has_post_thumbnail() ) {
the_post_thumbnail();
}
else {
echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/thumbnail-default.jpg" />';
}
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@outsmart
outsmart / bootstrap-brand-logo.php
Created October 22, 2015 00:04
Bootstrap Brand Logo Image Replacement
<a class="brand" href="<?php echo home_url(); ?>">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/dome-logo.png" alt="<?php bloginfo('name'); ?>">
</a>
@outsmart
outsmart / wordpress-page-excepts
Created October 21, 2015 05:37
Add excerpt to wordpress pages
<?php
//Add excepts to pages
add_action( 'init', __NAMESPACE__ . '\\my_add_excerpts_to_pages' );
function my_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}
?>

My Weather App

This is my free code camp zipline that allows a user to load the currrent weather for their lcoation.

A Pen by Paul Ballardin on CodePen.

License.