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 to display only upcoming events for Sugar Events Calendar on the main Events archive. | |
| function sc_filter_events( $query ) { | |
| if( is_post_type_archive('sc_event') && (!is_admin()) && ($query->is_main_query()) ) { | |
| $meta = array( | |
| array( | |
| 'key' => 'sc_event_date_time', | |
| 'value' => time(), |
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
| add_action( 'pre_get_posts', 'child_sort_post_order' ); | |
| function child_sort_post_order( $query ) { | |
| if ( is_post_type_archive('my_post_type') || is_tax() ){ | |
| $query->query_vars['orderby'] = 'title'; | |
| $query->query_vars['order'] = 'asc'; | |
| return; |
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
| /* | |
| http://csswizardry.com/2012/02/pragmatic-practical-font-sizing-in-css/ | |
| Housekeeping */ | |
| *{ margin:0; padding:0; } | |
| /* Define your base font-size here; most elements will inherit this. */ | |
| html{ | |
| font-size:1em; /* Assuming 16px... */ | |
| line-height:1.5; /* 24px (This is now our magic number; all subsequent margin-bottoms and line-heights want to be a multiple of this number in order to maintain vertical rhythm.) */ | |
| } |
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
| /* ================================================================================== | |
| THE TRICK | |
| Add text-shadow on the top-left and the bottom-right to smooth text | |
| =================================================================================== */ | |
| h1.title { /* It works very well with Windows XP (standard / cleartype method) */ | |
| text-shadow:-1px -1px 1px rgba(255,255,255,0.2), /* top-left */ | |
| 1px 1px 1px rgba(255,255,255,0.2), /* bottom-right */ | |
| 1px 1px 1px rgba(0,0,0,0.7); /* shadow */ |
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
| /* http://css-tricks.com/snippets/css/css-diagnostics/ */ | |
| /* Empty Elements */ | |
| div:empty, span:empty, li:empty, p:empty, td:empty, th:empty | |
| { padding: 20px; border: 5px dotted yellow !important; } | |
| /* Empty Attributes */ | |
| *[alt=""], *[title=""], *[class=""], *[id=""], a[href=""], a[href="#"] | |
| { border: 5px solid yellow !important; } | |
| /* Deprecated Elements */ |
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 | |
| function themename_customize_register($wp_customize){ | |
| $wp_customize->add_section('themename_color_scheme', array( | |
| 'title' => __('Color Scheme', 'themename'), | |
| 'priority' => 120, | |
| )); | |
| // ============================= |
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
| // Place the action in your theme setup function | |
| add_action('genesis_after_header','secundo_mobile_menu_primary'); | |
| // generates a dropdown select element for navigation on mobile devices | |
| function secundo_mobile_menu_primary(){ | |
| wp_nav_menu( | |
| array( | |
| 'menu' => 'Primary Navigation', // your theme location here | |
| 'walker' => new Walker_Nav_Menu_Mobile(), |
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 | |
| /** | |
| * Taxonomies | |
| * | |
| * This file registers any custom taxonomies | |
| * | |
| * @package WPS_Starter_Genesis_Child | |
| * @author Travis Smith <travis@wpsmith.net> | |
| * @copyright Copyright (c) 2012, Travis Smith | |
| * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
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 | |
| /* | |
| * JSON list of tweets using: | |
| * http://dev.twitter.com/doc/get/statuses/user_timeline | |
| * Cached using WP transient API. | |
| * http://www.problogdesign.com/wordpress/add-a-backup-to-embedded-tweets-in-wordpress/ | |
| */ | |
| // Configuration. | |
| $numTweets = 3; |
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
| // http://codex.wordpress.org/Function_Reference/wp_nav_menu#How_to_add_a_parent_class_for_menu_item | |
| add_filter('wp_nav_menu_objects', function ($items) { | |
| $hasSub = function ($menu_item_id, &$items) { | |
| foreach ($items as $item) { | |
| if ($item->menu_item_parent && $item->menu_item_parent==$menu_item_id) { | |
| return true; | |
| } | |
| } | |
| return false; | |
| }; |