This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <head> | |
| <!--Make IE8 use rems CSS the Foundation CSS grid, and be responsive with Foundation 5--> | |
| <!--[if lt IE 9]> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script> | |
| <script src="//s3.amazonaws.com/nwapi/nwmatcher/nwmatcher-1.2.5-min.js"></script> | |
| <script src="//html5base.googlecode.com/svn-history/r38/trunk/js/selectivizr-1.0.3b.js"></script> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.1.0/respond.min.js"></script> | |
| <![endif]--> | |
| <!-- Another example, this time "feeding" different files to IE8 and IE9 --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * -------------------------------------------------------------------------------// | |
| * Add buttons to WordPress HTML editor | |
| * @author @david | |
| * -------------------------------------------------------------------------------// | |
| */ | |
| function appthemes_add_quicktags() { | |
| ?> | |
| <script type="text/javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="container"> | |
| <div class="block-grid-lg-4 block-grid-md-3 block-grid-sm-2"> | |
| <div class="block-grid-item"> | |
| <h1>User 1</h1> | |
| </div> | |
| <div class="block-grid-item"> | |
| <h1>User 2</h1> | |
| </div> | |
| <div class="block-grid-item"> | |
| <h1>User 3</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function() { | |
| $('a[href*="#"]:not([href="#"])').click(function() { | |
| if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
| var target = $(this.hash); | |
| target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
| if (target.length) { | |
| $('html, body').animate({ | |
| scrollTop: target.offset().top | |
| }, 1000); | |
| return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Change "Posts" to "News" in the admin. | |
| add_action( 'admin_menu', 'intranet_rename_post_to_news_menu' ); | |
| add_action( 'init', 'intranet_rename_post_to_news' ); | |
| function intranet_rename_post_to_news_menu() { | |
| global $menu, $submenu; | |
| $menu[5][0] = 'News'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // paste this in functions.php file | |
| add_filter( 'the_content', 'featured_image_in_feed' ); | |
| function featured_image_in_feed( $content ) { | |
| global $post; | |
| if( is_feed() ) { | |
| if ( has_post_thumbnail( $post->ID ) ){ | |
| $output = get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'float:right; margin:0 0 10px 10px;' ) ); | |
| $content = $output . $content; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @david: add or remove classes at certain scrolling distances | |
| // the class names in this gist are meant as an example :-) | |
| $(window).scroll(function() { | |
| var y_scroll_pos = window.pageYOffset; | |
| var scroll_pos_test = 300; | |
| // set to whatever you want it to be | |
| if (y_scroll_pos > scroll_pos_test) { | |
| $(".menu").addClass("animated fadeInLeft"); | |
| // or add or remove pure CSS code: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {# find the children (subpages) of a parent page, in this case the "about" page #} | |
| <ul> | |
| {% for p in page.find('/about').children if p != page %} | |
| <li><a href="{{p.url}}">{{ p.title }}</a></li> | |
| {% endfor %} | |
| </ul> | |
| {# show all the pages with a certain category, in this case "cars" #} | |
| <h2>All the CAR posts</h2> | |
| <ul> |