Server: Nginx with Phusion Passenger
Ruby Version: 2.1.3
User System: deploy
| <?php | |
| $args = array( | |
| 'post_type' => 'product', | |
| 'meta_key' => '_featured', | |
| 'meta_value' => 'yes', | |
| 'posts_per_page' => 6 | |
| ); | |
| $featured_query = new WP_Query( $args ); | |
| if ($featured_query->have_posts()) : | |
| ?> |
| add_filter( 'woocommerce_loop_add_to_cart_link', 'mw_change_add_to_cart_loop' ); | |
| function mw_change_add_to_cart_loop( $product ) { | |
| global $product; // this may not be necessary as it should have pulled the object in already | |
| return '<a class="button" href="' . esc_url( $product->get_permalink( $product->id ) ) . '">DETALHES</a>'; | |
| } |
| add_filter( 'genesis_nav_items', 'be_follow_icons', 10, 2 ); | |
| add_filter( 'wp_nav_menu_items', 'be_follow_icons', 10, 2 ); | |
| /** | |
| * Follow Icons in Menu | |
| * @author Bill Erickson | |
| * @link http://www.billerickson.net/genesis-wordpress-nav-menu-content/ | |
| * | |
| * @param string $menu | |
| * @param array $args | |
| * @return string |
| user www-data; | |
| worker_processes auto; | |
| worker_rlimit_nofile 100000; | |
| pid /run/nginx.pid; | |
| events { | |
| worker_connections 10240; | |
| # multi_accept on; | |
| } |
| # put timestamps in my bash history | |
| export HISTTIMEFORMAT='%F %T ' | |
| # don't put duplicate commands into the history | |
| export HISTCONTROL=ignoredups | |
| # record only the most recent duplicated command (see above) | |
| export HISTCONTROL=ignoreboth | |
| # don't record these commands in the history; who cares about ls? |
| add_action( 'wp_enqueue_scripts', 'custom_enqueue_scripts' ); | |
| /** | |
| * Enqueue an external Custom Javascript file to Dynamik Website Builder | |
| */ | |
| function custom_enqueue_scripts() | |
| { | |
| wp_enqueue_script( 'my-scripts', dynamik_get_stylesheet_location( 'url' ) . 'my-scripts.js', array( 'jquery' ), CHILD_THEME_VERSION, true ); | |
| } |
| <?php remove_action( 'genesis_meta', 'dynamik_responsive_viewport' ); ?> |
| /** | |
| * Sanitize File name during upload | |
| * http://stackoverflow.com/questions/3259696/rename-files-during-upload-within-wordpress-backend | |
| */ | |
| function make_filename_hash($filename) { | |
| $info = pathinfo($filename); | |
| $ext = empty($info['extension']) ? '' : '.' . $info['extension']; | |
| $name = basename($filename, $ext); | |
| return md5($name) . $ext; | |
| } |
| <?php | |
| //* Do NOT include the opening php tag | |
| add_filter( "genesis_structural_wrap-footer-widgets", 'jmw_filter_footer_widgets_structural_wrap', 10, 2); | |
| /** | |
| * Filter the footer-widgets context of the genesis_structural_wrap to add a div before the closing wrap div. | |
| * | |
| * @param string $output The markup to be returned | |
| * @param string $original_output Set to either 'open' or 'close' | |
| */ |