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 | |
| function wpdocs_custom_excerpt_length( $length ) { | |
| return 20; | |
| } | |
| add_filter( 'excerpt_length', 'wpdocs_custom_excerpt_length', 999 ); | |
| ?> |
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 | |
| $categories = get_categories( array( | |
| 'orderby' => 'name', | |
| 'parent' => 0 | |
| ) ); | |
| $category_list = array(); | |
| foreach ( $categories as $category ) { | |
| $category_list[] = '<a href="' . get_category_link( $category->term_id ) . '">' . esc_html( $category->name ) . '</a> '; | |
| } |
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
| // Change Login Logo | |
| function my_login_logo() { ?> | |
| <style type="text/css"> | |
| #login h1 a, .login h1 a { | |
| background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/assets/images/site-login-logo.svg); | |
| padding-bottom: 2rem; | |
| background-size: 10rem 5rem; | |
| background-position: center top; | |
| background-repeat: no-repeat; | |
| color: #999; |
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
| /*jshint devel:true */ | |
| /*jslint eqeq: true*/ | |
| /*jshint unused:false*/ |
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
| function commaSeparateNumber(val){ | |
| while (/(\d+)(\d{3})/.test(val.toString())){ | |
| val = val.toString().replace(/(\d+)(\d{3})/, '$1'+','+'$2'); | |
| } | |
| return val; | |
| } | |
| $('#inputID').val(commaSeparateNumber(1234567890)); |
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
| if(Math.round(val) !== val) { | |
| val = val.toFixed(2); | |
| } |
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 ACF TO SEARCH RESULTS | |
| *******************************/ | |
| /* Join posts and postmeta tables: http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join */ | |
| function cf_search_join( $join ) { | |
| global $wpdb; | |
| if ( is_search() ) { | |
| $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id '; |
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
| <!-- PUT IN download.php: --> | |
| <?php | |
| /* | |
| * This code delivers a file, specified in the URL parameter, as a forced "Save As" download. | |
| */ | |
| // First, get WordPress loaded | |
| require_once('../../../wp-load.php'); // Modify this if necessary |
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 | |
| /** | |
| * Get blog posts page URL. | |
| * | |
| * @return string The blog posts page URL. | |
| */ | |
| function km_get_blog_posts_page_url() { | |
| // If front page is set to display a static page, get the URL of the posts 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
| <?php | |
| // Remove "Archives" from archive.php title | |
| add_filter( 'get_the_archive_title', function ( $title ) { | |
| if( is_category() ): // Swap out conditional for custom post types, etc. | |
| $title = single_cat_title( '', false ); | |
| endif; | |
| return $title; | |