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
| /** | |
| * News Summary: Display the most important information first. | |
| * | |
| * This code snippet adds a custom meta box called "News Summary" in the Post editor. | |
| * The meta box allows users to input a summary for each post, which will be displayed | |
| * at the beginning of the post's content on the single post page. | |
| */ | |
| // Register the Summary Meta Box | |
| function custom_news_summary_meta_box() { |
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 post list --post_type=post --format=ids --allow-root | xargs wp post update --post_status=draft --allow-root | |
| or | |
| wp post update $(wp post list --post_type=post --format=ids --allow-root) --post_status=draft --allow-root |
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
| #!/bin/bash | |
| # Define variables | |
| WORDPRESS_ABSPATH="/var/www/html" | |
| BUNNYCDN_EDGE_STORAGE_ZONE_URL="https://storage.bunnycdn.com" | |
| BUNNYCDN_EDGE_STORAGE_NAME="example-org-backup" | |
| BUNNYCDN_EDGE_STORAGE_PASSWORD="ENTER-STORAGE-SPECIFIC-PASSWORD-HERE-NOT-ACCOUNT-API" | |
| # Check if WP CLI is installed |
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
| server { | |
| listen 80; | |
| return 301 https://$host$request_uri; | |
| } | |
| server { | |
| # Document Root | |
| root /var/www/html; | |
| index index.php index.html index.htm; | |
| server_name demo.gulshankumar.net; | |
| client_max_body_size 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
| function remove_block_css() { | |
| wp_dequeue_style( 'wp-block-library' ); | |
| } | |
| add_action( 'wp_enqueue_scripts', 'remove_block_css', 20 ); | |
| // disable for posts | |
| add_filter('use_block_editor_for_post', '__return_false', 10); | |
| // disable for post types | |
| add_filter('use_block_editor_for_post_type', '__return_false', 10); |
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
| #!/bin/bash | |
| TEXT_RESET='\e[0m' | |
| TEXT_YELLOW='\e[0;33m' | |
| TEXT_RED_B='\e[1;31m' | |
| sudo apt update | |
| echo -e $TEXT_YELLOW | |
| echo 'APT update finished...' | |
| echo -e $TEXT_RESET |
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
| <script> | |
| const queryString = window.location.search; | |
| const urlParams = new URLSearchParams(queryString); | |
| const searchTerm = urlParams.get('q'); | |
| if (searchTerm) { | |
| const heading = document.querySelector('h1'); | |
| const title = document.querySelector('title'); | |
| heading.textContent = `Search Results for ${searchTerm}`; | |
| title.textContent = `Search Results for ${searchTerm}`; | |
| } |
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
| // Change Search path in the GeneratePress Theme | |
| add_filter( 'generate_navigation_search_output', function() { | |
| printf( | |
| '<form method="get" class="search-form navigation-search" action="%1$s"> | |
| <input type="search" placeholder=" Search" class="search-field" value="%2$s" name="q" title="%3$s" /> | |
| </form>', | |
| esc_url( home_url( '/search/' ) ), | |
| esc_attr( get_search_query() ), | |
| esc_attr_x( 'Search', 'label', 'generatepress' ) | |
| ); |
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
| <div class="gcse-searchbox-only"></div> | |
| <div class="gcse-searchresults-only"></div> |