Skip to content

Instantly share code, notes, and snippets.

@brendonexus
brendonexus / Bootstrap 4 Visible Style
Last active November 14, 2016 11:02
Bootstrap 4 Visible Style
<div class="hidden-sm-up">
visible XS
</div>
<div class="hidden-md-up hidden-xs-down">
visible SM
</div>
<div class="hidden-lg-up hidden-sm-down">
visible MD
</div>
<div class="hidden-xl-up hidden-md-down">
@brendonexus
brendonexus / style.scss
Last active October 15, 2019 11:27 — forked from mrl22/font-smoothing.css
Font smoothing
body {
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
font-smoothing: antialiased;
text-rendering: optimizeLegibility;
-webkit-text-size-adjust: 100%;
}
@brendonexus
brendonexus / Bootstrap 4 From Validation
Last active November 30, 2016 09:59
Boostrap 4 Form Validation
<?php
$field_name = 'field';
$field_label = 'Field';
?>
//INPUT FIELD
<div class="form-group <?php echo $_ERROR[$field_name] ? ' has-danger' : ''; ?>">
<label for="<?php echo $field_name; ?>"
class="col-sm-0 control-label"><?php echo $field_label; ?></label>
<?php
require '_config.php';
$twitteruser = 'webfwd';
$tweetexpire = 60 * 30; // Seconds
$tweetfile = DOCROOT.'/twitter.txt';
use Abraham\TwitterOAuth\TwitterOAuth;
if (!file_exists($tweetfile) || (time()-filemtime($tweetfile)) > $tweetexpire) {
$connection = new TwitterOAuth(
@brendonexus
brendonexus / bootstrap4.scss
Created December 16, 2016 12:53 — forked from mrl22/bootstrap4.scss
Bootstrap v4 SCSS Media Queries
$xl-down: "max-width: 9999px";
$lg-down: "max-width: 1199px";
$md-down: "max-width: 991px";
$sm-down: "max-width: 767px";
$xs-down: "max-width: 575px";
$xl-up: "min-width: 1200px";
$lg-up: "min-width: 992px";
$md-up: "min-width: 768px";
$sm-up: "min-width: 576px";
@brendonexus
brendonexus / default_wordpress_loop.php
Created February 13, 2017 15:02
Default Wordpress Loop
<?php
get_header();
if (have_posts()) :
while (have_posts()) :
the_post();
the_content();
endwhile;
endif;
get_sidebar();
get_footer();
@brendonexus
brendonexus / robots.txt
Created February 15, 2017 11:13
Disallow Robots
User-agent: *
Disallow: /
@brendonexus
brendonexus / bootstrap_vertical_center.css
Last active February 24, 2017 10:12
Vertical Center Image In Col Using CSS
/* add the following CSS to the image tag of image you want to vertically align inside the col */
img {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@brendonexus
brendonexus / Wordpress current template hook
Last active April 7, 2017 10:31
Wordpress current template hook
add_action('get_footer', 'show_template');
function show_template()
{
global $template;
if ($_SERVER['REMOTE_ADDR'] == 'ip_address') echo basename($template);
}
@brendonexus
brendonexus / Wordpress Pagination Function
Last active May 11, 2017 12:57
Wordpress Pagination Function
function your_custom_pagination() {
global $wp_query;
$total = $wp_query->max_num_pages;
if ( $total > 1 ) {
if ( !$current_page = get_query_var('paged') ) {
$current_page = 1;
}
echo paginate_links(array(
'base' => get_pagenum_link(1) . '%_%',
'format' => '?paged=%#%',