sudo apt update && sudo apt upgrade -ysudo apt autoremove && sudo apt clean
pbcopy < ~/.ssh/id_rsa.pub
| <?php | |
| /** | |
| * Change the name of the main Posts menu and submenus | |
| * and change the dashicon of the main menu item | |
| */ | |
| function chuck_change_post_type_menu() { | |
| global $menu; | |
| global $submenu; |
| /** | |
| * Add a CPT into main post/blog archive | |
| */ | |
| add_filter( 'pre_get_posts', 'chuckreynolds_add_cpts_to_post_archive' ); | |
| function chuckreynolds_add_cpts_to_post_archive( $query ) { | |
| if ( is_home() && $query->is_main_query() && empty( $query->query_vars['suppress_filters'] ) ) { | |
| $query->set( 'post_type', array( | |
| 'post', // assuming you still want normal posts in there |
| <?php | |
| function remove_comment_feeds( $for_comments ){ | |
| if( $for_comments ){ | |
| remove_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 ); | |
| remove_action( 'do_feed_atom', 'do_feed_atom', 10, 1 ); | |
| } | |
| } | |
| add_action( 'do_feed_rss2', 'remove_comment_feeds', 9, 1 ); | |
| add_action( 'do_feed_atom', 'remove_comment_feeds', 9, 1 ); |
| /** | |
| * Exclude a page and children pages from wp search by making an array | |
| * of page id's starting wtih 2927 == id (can't use page slugs) | |
| */ | |
| add_filter( 'pre_get_posts', 'filter_the_search' ); | |
| function filter_the_search( $query ) { | |
| if ( $query->is_search ) { | |
| $pages = array( 2927 ); // parent page ID |
| <?php | |
| /** | |
| * == About this Gist == | |
| * | |
| * Code to add to wp-config.php to enhance information available for debugging. | |
| * | |
| * You would typically add this code below the database, language and salt settings | |
| * | |
| * Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists). | |
| * |
| <?php | |
| // access wpseo_frontend class and get the seo title and seo description for output on archive pages | |
| if ( class_exists( 'WPSEO_Frontend' ) ) { | |
| $wpseo_object = WPSEO_Frontend::get_instance(); | |
| $headline = $wpseo_object->title( false ); | |
| $intro_text = $wpseo_object->metadesc( false ); | |
| } | |
| $headline = sanitize_text_field( $headline ); | |
| $intro_text = sanitize_text_field( $intro_text ); |
| <?php | |
| /* | |
| * Plugin Name: Local Dev Remote Images | |
| * Description: this will allow a local dev environment to call all images in uploads from a remote server | |
| * Version: 0.1 | |
| * License: GPL | |
| * Author: @chuckreynolds | |
| * Author URI: https://chuckreynolds.us | |
| */ |
| Verifying that +chuckreynolds is my openname (Bitcoin username). https://onename.com/chuckreynolds |
| <?php | |
| add_action( 'init', 'unregister_taxonomy_taxname'); | |
| function unregister_taxonomy_taxname(){ | |
| global $wp_taxonomies; | |
| $taxonomy = 'post_tag'; // tax slug to remove | |
| if ( taxonomy_exists( $taxonomy)) | |
| unset( $wp_taxonomies[$taxonomy]); | |
| } |