Mô tả
WordPress can be sometimes slow and make a lot of call to the database when you want to display a lot of posts with featured images in on beautifull long scrolling page. I a case like that you need to hit the database to get the featured image of every post.
JSON Cache fix this issue. it allow you to generate a json file that content all the informations of a post so the user when visiting your site just need to open the json file.
Cài đặt
- Upload
json-cache
to the/wp-content/plugins/
directory - Activate the plugin through the ‘Plugins’ menu in WordPress
- go to JSON CACHE and click Generate Cached Content (make sure your data folder is writeable)
Getting all posts
$json_cache = new JSONCache();
$jsonposts = $json_cache->getJsonData(‘posts’);
Getting all pages
$json_cache = new JSONCache();
$jsonpages = $json_cache->getJsonData(‘pages’);
Getting a specific post
$json_cache = new JSONCache();
$jsonpost = $json_cache->getJsonData(‘post_1’);
Settings
you can also add a custom image size:
$json_cache = new JSONCache();
$json_cache->add_image_size( ‘thibautdelille-full-width’);
Đánh giá
There are no reviews for this plugin.
Người đóng góp & Lập trình viên
“JSON Cache Plugin” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.
Những người đóng gópDịch “JSON Cache Plugin” sang ngôn ngữ của bạn.
Muốn tham gia phát triển?
Duyệt code, check out SVN repository, hoặc theo dõi nhật ký phát triển qua RSS.
Nhật ký thay đổi
0.1
- save all pages, all posts and each individuals post in json file
- retrieve json data in the templates
- add custom images sizes