Skip to content

Instantly share code, notes, and snippets.

@codente
codente / bb-pre-populate-page-template.php
Created October 5, 2021 13:28
bb-pre-populate page with template
// Uses the add_meta_boxes_{post_type} hook for given post type
// change page in hook to your post type where you want this to happen
add_action( 'add_meta_boxes_page', 'page_default_content' );
function page_default_content( WP_Post $page ) {
// Add the meta data fields you want the custom post type to grab
$page_meta_data = [
'_fl_builder_enabled',
'_fl_builder_data_settings',
@codente
codente / beaverbuilder-jump-links.js
Created February 16, 2017 22:55 — forked from TwisterMc/beaverbuilder-jump-links.js
Make jump links between pages work better when there is a fixed header.
@codente
codente / gist:cc27a4d6f87ed0094831
Created July 14, 2015 18:23
Shrink sticky wrapper on scroll - w/o logo
.wrapper.is_stuck { transition: font-size 500ms ease; font-size: 90%; transition: height 500ms ease;}
.wrapper.is_stuck .block { transition: height 500ms ease;}
.wrapper.is_stuck .block .nav-horizontal ul.menu > li > a { line-height: 50px; transition: all 500ms ease; }
.wrapper.is_stuck .block-type-header span.banner a {font-size: 150%; transition: all 500ms ease;}
@codente
codente / gist:7d7cb405e22f67b5f0ea
Last active August 29, 2015 14:24
Shrink sticky wrapper on scroll - w/ logo
.wrapper.is_stuck { transition: font-size 500ms ease; font-size: 80%; transition: height 500ms ease;}
.wrapper.is_stuck .block { transition: height 500ms ease;}
.wrapper.is_stuck .block .nav-horizontal ul.menu > li > a { line-height: 50px; transition: all 500ms ease; }
.wrapper.is_stuck .block a > img{ transform: scale(.5); transition: all 500ms ease;}
@codente
codente / gist:7794975f2cefcf86f2be
Last active August 29, 2015 14:18
Table styling example
.custom .footer-widgets {background: #222;} /* sets background color for footer widgets class. assign this in the config tab
of wrapper or block options */
.custom .footer-widgets table#wp-calendar caption {color: #fff;} /* sets the calendar title to white */
.custom .footer-widgets table#wp-calendar tr th {color: #e6e6e6;} /* sets the table headings to grey */
.custom .footer-widgets table#wp-calendar tr td {color: #e6e6e6;} /* sets the table conents to grey */
.custom .footer-widgets table#wp-calendar tr td#today {color: red;} /* sets the highlighted day (today) to red */
@codente
codente / gist:d5b970ace54bd70c6ac1
Created March 10, 2015 18:47
Typekit Header Code
<script src="//use.typekit.net/one3gcz.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
@codente
codente / gist:8300f6d36499dd8c7cbc
Created February 25, 2015 22:21
Headway: Dynamic Copyright Year (JS)
&copy; Headway Themes <script>document.write(new Date().getFullYear())</script>. All Rights Reserved.
@codente
codente / gist:2279128d4021d0f707dd
Last active August 29, 2015 14:16
Headway: Dynamic Copyright year (PHP)
&copy; Headway Themes <?php echo date('Y');?>. All Rights Reserved.
@codente
codente / gist:88e266d4816597be8de5
Last active August 29, 2015 14:15
Headway: Above Title Featured Images tutorial
/* --- FEATURED IMAGES - ABOVE TITLE --- */
.custom a.post-thumbnail-above-title {margin: -2rem -2rem 0 -2rem;} /* remove margins around featured image only */
.custom a.post-thumbnail-above-title > img {padding: 0; border: 0;} /* remove padding around featured image only */
.custom a.post-thumbnail-above-title ~ header {margin-top: 3%;} /* put space between featured image and post title */
@codente
codente / gist:4ff4fed9923933c583fe
Last active August 29, 2015 14:15
Headway: Conditional javascript in Header/Footer Scripts
<?php
if(is_page('portfolio')) {
echo '
<script type="text/javascript">
jQuery(document).ready(function($){
$(".hide").click(function(){
$(".hide").hide();
});
});
</script>