sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y apache2
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
| // Get WordPress site name via shortcode: [nf_site_name] | |
| function nf_site_name_shortcode() { | |
| return get_bloginfo('name'); | |
| } | |
| add_shortcode('nf_site_name','nf_site_name_shortcode'); |
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
| { | |
| "locations": [ | |
| { | |
| "name": "New York", | |
| "slug": "", | |
| "description": "", | |
| "meta": [ | |
| {"image_id" : 45}, | |
| {"_icon" : ""} | |
| ], |
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
| /** | |
| * WordPress URL Exclude List for Screaming Frog Spider | |
| * @author TJ Kelly - https://tjkelly.com | |
| * @desc Full article — https://tjkelly.com/blog/screaming-frog-exclude-wordpress/ | |
| * @date 2021-07-08 | |
| */ | |
| https://example.com/wp-content/.* | |
| https://example.com/wp-content/mu-plugins/.* | |
| https://example.com/wp-content/plugins/.* |
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
| # Location: /mnt/c/windows/system32/drivers/etc/hosts | |
| 127.0.0.1 virtualhost.local www.virtualhost.local |
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_action('admin_init', function () { | |
| // Redirect any user trying to access comments page | |
| global $pagenow; | |
| if ($pagenow === 'edit-comments.php') { | |
| wp_redirect(admin_url()); | |
| exit; | |
| } |
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 a Beaver Builder Template to the bottom of the Beaver Builder Theme vertical menu | |
| add_filter( 'wp_nav_menu_items', 'your_custom_menu_item', 10, 2 ); | |
| function your_custom_menu_item ( $items, $args ) { | |
| // if the menu is in fact our header menu | |
| if ($args->theme_location == 'header') { | |
| // get the content of our Beaver Builder Template | |
| $bb_content = do_shortcode('[fl_builder_insert_layout slug="vertical-menu-content-bottom"]'); | |
| // append the content of our Beaver Builder Template to the end of our menu | |
| $items .= $bb_content; | |
| } |
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
| SELECT CONCAT( 'ALTER TABLE ', TABLE_NAME, ' ENGINE=InnoDB;' ) | |
| FROM INFORMATION_SCHEMA.TABLES | |
| WHERE ENGINE = 'MyISAM' | |
| AND table_schema = 'database-name-here'; |
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 code snippet removes JavaScript and CSS files loaded from WooCommerce if they are not necessary. | |
| * | |
| * Please test this on a staging copy of your website before putting this into the functions.php of your live website. | |
| */ | |
| add_action( 'wp_enqueue_scripts', 'my_remove_woo_assets', 99 ); | |
| function my_remove_woo_assets() { | |
| if ( function_exists( 'is_woocommerce' ) ) { // Check if Woo is installed. | |
| if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { // Only run on non-Woo pages. | |
| // Remove unnecessary stylesheets. |
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 | |
| /** | |
| * Block helpers | |
| * add special classes when certain blocks appear, put this in your functions.php file or include it somewhere | |
| */ | |
| // add block classes in body and post class | |
| function blocks_body_class( $classes ) { | |
| global $post; |
NewerOlder