Free.ai WordPress Plugin
AI tools for WordPress. Content generation, images, and more.
Free.ai cho WordPress
Thêm AI-powered content generation, image creation, text-to-speech, và translation trực tiếp vào trang WordPress của bạn bằng cách sử dụng shortcodes và REST API của chúng tôi.
Bắt đầu nhanh: Nạp widget
Cách nhanh nhất để thêm AI vào trang WordPress của bạn. Đưa nó vào bất kỳ trang, bài viết, hay widget nào bằng trình biên tập HTML:
<script src="https://free.ai/widget.js" data-tool="chat"></script>
Điều này thêm giao diện trò chuyện AI vào trang của bạn. Xem trang Widget cho tất cả các công cụ có sẵn.
Mã ngắn tùy chỉnh (PHP) Name
Create a WordPress shortcode that calls the Free.ai API. Add this to your theme's functions.php:
function freeai_generate($atts) {
$atts = shortcode_atts(['prompt' => '', 'model' => 'qwen7b'], $atts);
$response = wp_remote_post('https://api.free.ai/v1/chat/completions', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Content-Type' => 'application/json',
],
'body' => json_encode([
'model' => $atts['model'],
'messages' => [['role' => 'user', 'content' => $atts['prompt']]],
]),
]);
if (is_wp_error($response)) return 'Error generating content.';
$body = json_decode(wp_remote_retrieve_body($response), true);
return '<div class="freeai-output">' .
esc_html($body['choices'][0]['message']['content'] ?? '') .
'</div>';
}
add_shortcode('freeai', 'freeai_generate');
Sau đó dùng nó trong bất kỳ bài viết hay trang nào:
[freeai prompt="Write a 100-word product description for organic coffee"]
WordPressName
- Tự động tạo meta mô tả SEO cho bài viết
- Tạo hình ảnh dựa trên AI cho các hình ảnh nổi bật
- Tự động dịch bài viết sang nhiều ngôn ngữ
- Thêm âm thanh văn bản- thành- lời nói vào bài viết
- AI chatbot cho hỗ trợ khách
- Tóm tắt nội dung cho các bài viết dạng dài