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
| const http = require( 'http' ) | |
| const server = http.createServer( ( req, res ) => { | |
| console.log( req.url ) | |
| switch( req.url ) { | |
| case '/': | |
| res.end( 'The Homepage' ) |
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
| node index.js |
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
| const http = require( 'http' ) | |
| // Create and start a server with the | |
| // createServer method from http package | |
| const server = http.createServer( ( req, res ) => { | |
| console.log(req.url) | |
| res.end( 'Hello node.js' ) | |
| } ) | |
| // start our server to start taking request |
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
| mkdir my-cool-app && cd my-cool-app && touch index.js |
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
| # Install node with Brew: | |
| brew install node | |
| node -v |
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.domReady( function() { | |
| wp.richText.unregisterFormatType( 'core/bold' ); | |
| wp.richText.unregisterFormatType( 'core/italic' ); | |
| wp.richText.unregisterFormatType( 'core/strikethrough' ); | |
| wp.richText.unregisterFormatType( 'core/subscript' ); | |
| wp.richText.unregisterFormatType( 'core/superscript' ); | |
| wp.richText.unregisterFormatType( 'core/text-color' ); | |
| wp.richText.unregisterFormatType( 'core/image' ); | |
| wp.richText.unregisterFormatType( 'core/underline' ); | |
| wp.richText.unregisterFormatType( 'core/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
| <?php | |
| // in the loop | |
| $category = get_the_category(); | |
| $currentcat = $category[0]->cat_ID; | |
| $currentcatname = $category[0]->cat_name; | |
| $currentcatslug = $category[0]->slug; | |
| // outside the loop | |
| global $post; | |
| $categories = get_the_category($post->ID); |
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.data.dispatch( 'core/edit-post').removeEditorPanel( 'taxonomy-panel-category' ) ; // category | |
| wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'taxonomy-panel-TAXONOMY-NAME' ) ; // custom taxonomy | |
| wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'taxonomy-panel-post_tag' ); // tags | |
| wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'featured-image' ); // featured image | |
| wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'post-link' ); // permalink | |
| wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'page-attributes' ); // page attributes | |
| wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'post-excerpt' ); // Excerpt | |
| wp.data.dispatch( 'core/edit-post').removeEditorPanel( 'discussion-panel' ); // Discussion |
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 to existing function.php file | |
| // Disable support for comments and trackbacks in post types | |
| function df_disable_comments_post_types_support() { | |
| $post_types = get_post_types(); | |
| foreach ($post_types as $post_type) { | |
| if(post_type_supports($post_type, 'comments')) { | |
| remove_post_type_support($post_type, 'comments'); |
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
| // Trim Homepage cards on Mobile | |
| // if ($(window).width() < 700) { | |
| // // Select Each Card Section | |
| // let cardsSel = $('[class^="sec-"] .category__card-title'); | |
| // // Get Only THe Items after the First Child | |
| // let divToTrim = $.grep(cardsSel, function (x, index) { | |
| // return (index % 4) != 0; | |
| // }); | |
| // // Iterate over the array and get the Text |