Upload, Resize and Save images with Intervention Image v3 in Laravel Storage. Test UploadedFile::fake() with real image file.
<form action="/upload/avatar" method="post" enctype="multipart/form-data">
@csrf
<label>Image</label>
<html> | |
<head> | |
<title>Page Title</title> | |
<script type="application/ld+json"> | |
{ | |
"@context": "https://schema.org", | |
"@type": "WebSite", | |
"name": "Page Title", | |
"url": "https://example.org" |
Link i kod polecający z hostingu https://small.pl
F4KXR477Z1
<?php | |
/* | |
* Set post views count using post meta | |
* Add to: single.php | |
*/ | |
function countPostViews($key = 'post_views_count') { | |
$postID = get_the_ID(); | |
$count = get_post_meta($postID, $key, true); | |
// Update the custom field value. | |
if($count == ''){ |
<?php | |
// Post formats | |
add_theme_support('post-formats', ['aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat']); | |
// Enable post thumbnails | |
add_theme_support('post-thumbnails'); | |
// Update default thumbnails size (post-thumbnail, medium_large) | |
set_post_thumbnail_size(1280, 720, true); |
<?php | |
// Disable auto updates | |
add_filter('auto_update_plugin', '__return_false'); | |
add_filter('auto_update_theme', '__return_false'); | |
function load_css() { | |
// Load bootstrap css | |
wp_register_style('bootstrap', get_template_directory_uri() . '/css/bootstrap/bootstrap.min.css', [], false, 'all'); | |
wp_enqueue_style('bootstrap'); |
<div class="navigation"> | |
<?php | |
global $wp_query; | |
$big = 999999999; // need an unlikely integer | |
echo paginate_links( array( | |
'base' => str_replace($big, '%#%', esc_url(get_pagenum_link( $big ))), | |
'format' => '?paged=%#%', | |
'current' => max(1, get_query_var('paged')), |
<?php | |
// Search only in posts with wordpress ?s= | |
function search_filter($query) { | |
if ($query->is_search) { | |
$query->set('post_type', 'post'); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','search_filter'); |
<?php | |
/** | |
* Subscribe user | |
*/ | |
function subscribe_user(WP_REST_Request $request) { | |
// $params = $request->get_params(); | |
// $email = $params['email']; | |
$email = $request->get_param('email'); | |
return [ |