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
| /* getContentsofDir v0.1 | |
| * This function gets the contents of a directory. | |
| * It returns an array ($contentsArr) of strings for each item in the target directory | |
| * $dir : The path of the directory to search in | |
| * Attributes: | |
| ignoreSystemFiles: Do not include system files in the array | |
| Such as: ., .., DS_Store | |
| num: How many entries to return. 0 will return all | |
| ignore: Ignore this file(s) | |
| ignoreType: Ignore this file type(s) |
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 | |
| //vvvvvvvvvv *INCLUDE_FUNCTIONS vvvvvvvvvv | |
| /* phpReadDir v0.1 | |
| * This function gets the contents of a directory. | |
| * It returns an array ($contentsArr) of strings for each item in the target directory | |
| * $dir : The path of the directory to search in | |
| * Attributes: | |
| ignoreSystemFiles: Do not include system files in the array | |
| Such as: ., .., DS_Store | |
| num: How many entries to return. 0 will return all |
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
| .hoverSpriteVert, | |
| .hoverSpriteHoriz | |
| background-position: 0 0 | |
| .hoverSpriteHoriz:hover | |
| background-position: 100% 0 | |
| .hoverSpriteVert:hover | |
| background-position: 0 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
| //Template fallback | |
| add_action("template_redirect", 'my_theme_redirect'); | |
| function my_theme_redirect() { | |
| global $wp; | |
| $plugindir = dirname( __FILE__ ); | |
| //A Specific Custom Post Type | |
| if ($wp->query_vars["post_type"] == 'product') { | |
| $templatefilename = 'single-product.php'; |
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
| /** | |
| * Disable admin bar on the frontend of your website | |
| * for subscribers. | |
| */ | |
| function themeblvd_disable_admin_bar() { | |
| if( ! current_user_can('edit_posts') ) | |
| add_filter('show_admin_bar', '__return_false'); | |
| } | |
| add_action( 'after_setup_theme', 'themeblvd_disable_admin_bar' ); | |
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
| //This would be good for setting up a stock dev environment. So instead of dumping in a DB, you would run an initializer with options | |
| $users[0] = array( | |
| 'first_name' => 'Daniel', | |
| 'last_name' => 'Pataki', | |
| 'user_login' => 'danielpataki', | |
| 'user_pass' => 'mysupersecretpass', | |
| 'user_email' => '[email protected]', | |
| 'display_name' => 'Daniel', | |
| 'description' => 'Guitar-wielding Web developer', |
NewerOlder