Add custom field name and value as follows
Name: query_args
Value: cat=107
here 107 is category ID
Add custom field name and value as follows
Name: query_args
Value: cat=107
here 107 is category ID
Leverage browser caching specify how long web browsers should keep images, CSS and JS stored locally. Add the following lines to the .htaccess file.
## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access 1 year" ExpiresByType image/jpeg "access 1 year" ExpiresByType image/gif "access 1 year" ExpiresByType image/png "access 1 year" ExpiresByType text/css "access 1 month" ExpiresByType application/pdf "access 1 month" ExpiresByType application/javascript "access 1 month" ExpiresByType application/x-javascript "access 1 month" ExpiresByType application/x-shockwave-flash "access 1 month" ExpiresByType image/x-icon "access 1 year" ExpiresDefault "access 2 days" </IfModule> ## EXPIRES CACHING ##
Add the following lines to your WordPress .htaccess
<IfModule mod_headers.c>
<FilesMatch ".(js|css|xml|gz|html)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>
How to speedup your slow WordPress website?
function thumbpost_list_shortcode($atts){
extract( shortcode_atts( array(
'count' => 3,
), $atts) );
$q = new WP_Query(
array('posts_per_page' => $count, 'post_type' => 'post')
);
$list = '<ul>';
while($q->have_posts()) : $q->the_post();
$idd = get_the_ID();
$list .= '
<li>
<img src="<?php echo get_template_directory_uri(); ?>/assets/img/latest-post/1.png" alt="" />
'.get_the_post_thumbnail($idd,'thumbnail').'
<p><a href="'.get_permalink().'">'.get_the_title().'</a></p>
<span>'.get_the_date('d F Y', $idd ).'</span>
</li>
';
endwhile;
$list.= '</ul>';
wp_reset_query();
return $list;
}
add_shortcode('latest_post', 'thumbpost_list_shortcode');