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
yarn create nuxt-app <my-project> |
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 | |
//custom excrept length in words | |
add_filter( 'excerpt_length', function(){ return 40; }, 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 | |
$img = wp_get_attachment_image_src(get_post_thumbnail_id(get_option('page_for_posts')),'full'); | |
$featured_image = $img[0]; | |
?> |
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_filter('jpeg_quality', function($arg){return 90;}); | |
?> |
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 | |
if( current_user_can('administrator')) | |
add_filter( 'show_admin_bar', '__return_true' , 1000 ); | |
?> |
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_image_size( 'homepage-thumb', 270, 175, false ); //soft crop = resize | |
add_image_size( 'search-thumb', 150, 150, true ); //hard crop | |
add_filter( 'image_size_names_choose', 'my_custom_sizes' ); | |
function my_custom_sizes( $sizes ) { | |
return array_merge( $sizes, array( | |
'homepage-thumb' => __( 'Homepage Thumb' ), | |
'search-thumb' => __( 'Search Thumb' ), | |
) ); |
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
#Force SSL | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
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
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^example\.com [NC] | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://example.com/$1 [R,L] |
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
npm ls -g --depth 0 |
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
// Storing a single value works fine with define | |
define( 'ROOT_DIR', dirname(dirname(__FILE__)) . '/' ); | |
// But not for complex data types like this array | |
$USERPIC_PARAMS = array( | |
"user_root" => "images/users", | |
"padding_length" => 8, | |
"split_length" => 4, | |
"hash_length" => 12, | |
"hide_leftover" => false |
NewerOlder