As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
configdocs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public - Sep 07, 2020 update docs for
npm version
| function is_blog () { | |
| global $post; | |
| $posttype = get_post_type($post ); | |
| return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ; | |
| } | |
| Usage: | |
| <?php if (is_blog()) { echo 'You are on a blog page'; } ?> |
| <?php | |
| /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ | |
| /** | |
| * Converts to and from JSON format. | |
| * | |
| * JSON (JavaScript Object Notation) is a lightweight data-interchange | |
| * format. It is easy for humans to read and write. It is easy for machines | |
| * to parse and generate. It is based on a subset of the JavaScript | |
| * Programming Language, Standard ECMA-262 3rd Edition - December 1999. |
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |