A Pen by Mrfoxtalbot on CodePen.
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
| @font-face { | |
| font-family: 'Your Custom Font'; | |
| src: url('fonts/webfont.eot'); /* IE9 Compat Modes */ | |
| src: url('fonts/webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ | |
| url('fonts/webfont.woff') format('woff'), /* Modern Browsers */ | |
| url('fonts/webfont.ttf') format('truetype'), /* Safari, Android, iOS */ | |
| url('fonts/webfont.svg#svgFontName') format('svg'); /* Legacy iOS */ | |
| } |
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 | |
| /** | |
| * Redirect users to custom URL based on their role after login | |
| * | |
| * @param string $redirect | |
| * @param object $user | |
| * @return string | |
| */ | |
| function wc_custom_user_redirect( $redirect, $user ) { | |
| // Get the first of all the roles assigned to the user |
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
| // Load translation files from your child theme instead of the parent theme | |
| function my_child_theme_locale() { | |
| load_child_theme_textdomain( 'total', get_stylesheet_directory() . '/languages' ); | |
| } | |
| add_action( 'after_setup_theme', 'my_child_theme_locale' ); |
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
| /** | |
| * Set a custom add to cart URL to redirect to | |
| * @return string | |
| */ | |
| function custom_add_to_cart_redirect() { | |
| return 'http://www.yourdomain.com/your-page/'; | |
| } | |
| add_filter( 'woocommerce_add_to_cart_redirect', 'custom_add_to_cart_redirect' ); |
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
| // Edit order items table template defaults | |
| function sww_add_wc_order_email_images( $table, $order ) { | |
| ob_start(); | |
| $template = $plain_text ? 'emails/plain/email-order-items.php' : 'emails/email-order-items.php'; | |
| wc_get_template( $template, array( | |
| 'order' => $order, | |
| 'items' => $order->get_items(), | |
| 'show_download_links' => $show_download_links, |
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 | |
| // 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> |
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_shortcode( 'areas', 'custom_query_shortcode' ); | |
| function custom_query_shortcode( $atts ) { | |
| // EXAMPLE USAGE: | |
| // [areas show_posts="100" post_type="page" post_parent="246"] | |
| // Defaults | |
| $defaults = array( | |
| "show_posts" => 100, | |
| "post_type" => 'page', |
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
| Movable Type has never been Free Software, as defined by the Free Software | |
| Foundation. It has never been open source software, as defined by the Open | |
| Source Initiative. Six Apart survived and thrived in the blogging community | |
| because Movable Type was “free enough.” | |
| … | |
| Many people misunderstand | |
| Free Software and the GNU General Public License. Many people equate the GPL to | |
| the boogeyman, because it’s “viral”, and that sounds like a bad thing. |
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
| Try this. Add the code below to your functions.php file - | |
| add_shortcode('cat_description', 'my_cat_description_shortcode'); | |
| function my_cat_description_shortcode($atts){ | |
| $a = shortcode_atts( array( | |
| 'id' => 0, | |
| ), $atts ); | |
| return category_description($a['id']); |