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 | |
| /** | |
| * Plugin Name: My Custom Functions | |
| * Plugin URI: http://yoursite.com | |
| * Description: This is an awesome custom plugin with functionality that I'd like to keep when switching things. | |
| * Author: Your Name | |
| * Author URI: http://yoursite.com | |
| * Version: 0.1.0 | |
| */ |
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 | |
| /** | |
| * Plugin Name: My Custom Functions | |
| * Plugin URI: http://yoursite.com | |
| * Description: This is an awesome custom plugin with functionality that I'd like to keep when switching things. | |
| * Author: Your Name | |
| * Author URI: http://yoursite.com | |
| * Version: 0.1.0 | |
| */ |
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
| #somediv { | |
| background: -webkit-linear-gradient(top, #efefef 99%, #ddd 99%, #f2eded 100%, #fff 100%); | |
| } |
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
| /** | |
| * A jQuery snippet for creating a gallery of images that fade in/out when thumbs are clicked on. | |
| * Give the main images an id of "prod#" where # is the number corresponding to the thumbnail's data-file="prod#" | |
| * | |
| */ | |
| <script> | |
| (function($) { | |
| // var featuredProd = $('.prod'); | |
| // featuredProd.filter(':nth-child(n+2)').addClass('hide'); | |
| // $('.grid-thumbs li').click(function() |
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
| <ul><!-- read this https://codex.wordpress.org/Class_Reference/WP_Query --> | |
| <?php // The WordPress Loop - customized with WP_Query | |
| $args = array( | |
| 'post_type' => 'wpsc-product', | |
| 'wpsc_product_category' => 'awesome-products' | |
| ); | |
| $custom_query = new WP_Query($args); // exclude Asides category | |
| while($custom_query->have_posts()) : $custom_query->the_post(); ?> | |
| <li> |
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 wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ?> |
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
| /* Inset look on cancel button */ | |
| -webkit-box-shadow: 0px 1px 0px #fff, inset 0px 1px 0px #fff; |
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
| /************************************** | |
| * WP Tuts theme options page | |
| **************************************/ | |
| // From here: http://wp.tutsplus.com/tutorials/the-complete-guide-to-the-wordpress-settings-api-part-1/ | |
| // Add Theme Options menu to Appearance Menu | |
| function boiler_theme_menu() { | |
| add_theme_page( |
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
| /* append additional article links that are also within the current post's category | |
| cannot contain current posting | |
| must be limited to current category only | |
| must compensate for articles that were posted in more than one category */ | |
| add_filter('the_content', function($content){ | |
| $id = get_the_id(); // get the id of the current post | |
| if ( !is_singular('post')){ // if it's anything other than a single post, just output content | |
| return $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
| /* [twitter ] | |
| add_shortcode('twitter', function($atts, $content) { // $atts is an array | |
| // override the $atts we have by returning shortcode_atts in a variable called $atts | |
| $atts = shortcode_atts( // store what's returned by shortcode_atts in $atts | |
| array( | |
| 'username' => 'envatowebdev', | |
| 'content' => !empty($content) ? $content : 'Follow me on Twitter!' | |
| ), $atts // override our defaults above with the attributes supplied by user | |
| ); |