Version: 1.9.8
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
| <?php | |
| // Add Post Excerpt Support to WordPress Pages | |
| add_action( 'init', 'my_add_excerpts_to_pages' ); | |
| function my_add_excerpts_to_pages() { | |
| add_post_type_support( 'page', 'excerpt' ); | |
| } |
| <?php | |
| /* Convert hexdec color string to rgb(a) string */ | |
| function hex2rgba($color, $opacity = false) { | |
| $default = 'rgb(0,0,0)'; | |
| //Return default if no color provided | |
| if(empty($color)) | |
| return $default; |
| <?php | |
| //* Add new image sizes | |
| add_image_size( 'logo-thumb', 270, 180, TRUE ); | |
| //* Change the number of portfolio items to be displayed (props Bill Erickson) | |
| add_action( 'pre_get_posts', 'minimum_portfolio_items' ); | |
| function minimum_portfolio_items( $query ) { | |
| if ( $query->is_main_query() && !is_admin() && is_post_type_archive( 'portfolio' ) ) { | |
| $query->set( 'posts_per_page', '6' ); |
| <?php | |
| // Remove Genesis Default Stylesheet | |
| remove_action( 'genesis_meta', 'genesis_load_stylesheet' ); | |
| //* Unregister layout settings | |
| genesis_unregister_layout( 'content-sidebar-sidebar' ); | |
| genesis_unregister_layout( 'sidebar-content-sidebar' ); | |
| genesis_unregister_layout( 'sidebar-sidebar-content' ); | |
| //* Unregister secondary sidebar |
| <?php | |
| // This file assumes that you have included the nav walker from https://github.com/twittem/wp-bootstrap-navwalker | |
| // somewhere in your theme. | |
| ?> | |
| <header class="banner navbar navbar-default navbar-static-top" role="banner"> | |
| <div class="container"> | |
| <div class="navbar-header"> | |
| <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse"> | |
| <span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span> |
| <?php | |
| /** | |
| Need to run this code just ONCE, | |
| so remove it after one pageload once spaces are removed | |
| **/ | |
| # List of Taxonomies with terms which have leading spaces | |
| $taxos = array('rooms', 'settings', 'views', 'features'); | |
| #!/bin/sh | |
| # replace cmd1 for the command to execute | |
| host=192.168.1.1 | |
| port=23 | |
| user=admin | |
| pass=02B08 | |
| cmd1='adsl info' | |
| current_date_time="`date +%Y-%m-%d\ %H:%M:%S`"; | |
| ( echo open ${host} |
| <?php | |
| # Inlcude in functions file for one time | |
| # Remove after calling this function on some page one time | |
| function warmarks_update_new_meta_from_old(){ | |
| # Provide your custom values here: | |
| $post_type = 'pdf'; //change it with your post type | |
| $old_metaKey = 'ecpt_pdflink'; | |
| $new_metaKey = '_jb_pdf'; |