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
| // Source: https://wpcolt.com/fix-hentry-errors-wordpress/ | |
| add_filter( 'post_class', 'remove_hentry' ); | |
| function remove_hentry( $class ) { | |
| $class = array_diff( $class, array( 'hentry' ) ); | |
| return $class; | |
| } |
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
| # http config block | |
| map $http_accept $webp_ext { | |
| default ""; | |
| "~*webp" ".webp"; | |
| } | |
| # server config block | |
| location ~* ^/wp-content/.+\.(png|jpg)$ { | |
| add_header Vary Accept; | |
| try_files $uri$webp_ext $uri =404; |
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
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteCond %{HTTP_ACCEPT} image/webp | |
| RewriteCond %{DOCUMENT_ROOT}/$1.webp -f | |
| RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1] | |
| </IfModule> | |
| <IfModule mod_headers.c> | |
| Header append Vary Accept env=REDIRECT_accept | |
| </IfModule> |
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 setup_theme(){ | |
| load_theme_textdomain('theme_text_domain', get_template_directory() . '/languages'); | |
| } | |
| add_action('after_setup_theme', 'setup_theme'); |
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
| /* | |
| Theme Name: Your theme name | |
| Theme URI: Your theme URL | |
| Text Domain: theme_text_domain | |
| */ |
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
| _n( $single, $plural, $number, $domain ) | |
| as | |
| sprintf( _n('This page contains %d post.', 'This page contains %d posts.', $num_posts, 'theme_text_domain'), $num_posts ); |
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
| ‘<h2>’.sprintf(__(‘This page contains %s posts.’ , 'theme_text_domain') , $num_posts).’</h2>’; |
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
| sprintf(__(‘<h2>This page contains %s posts.</h2>’ , 'theme_text_domain') , $num_posts) ; |
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
| sprintf(__(‘This page contains %s posts.’ , 'theme_text_domain') , $num_posts) ; |
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
| _e('Hello World', 'theme_text_domain'); |