Free.ai WordPress Plugin
AI tools for WordPress. Content generation, images, and more.
Free.ai สำหรับ WordPress
เพิ่มการสร้างเนื้อหาที่ใช้พลังงาน AI, การสร้างภาพ, ข้อความเป็นเสียง, และแปลโดยตรงไปยังเว็บไซต์ WordPress ของคุณโดยใช้ shortcodes และ REST API ของเรา
เริ่มเร็ว: ฝังวิดเจ็ต
วิธีการที่รวดเร็วที่สุดในการเพิ่ม AI เข้าไปในเว็บไซต์ WordPress ของคุณ พิมพ์มันลงในหน้าใด ๆ บทความ หรือวิดเจ็ต โดยใช้เครื่องมือแก้ไข HTML:
<script src="https://free.ai/widget.js" data-tool="chat"></script>
เพิ่มส่วนติดต่อสื่อสารแบบ AI เข้าไปในหน้าของคุณ ลองดูที่ Widget page เพื่อดูเครื่องมือที่ใช้ได้ทั้งหมด
ส่วนเสริม
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');
ใช้มันในบทความหรือหน้าใดๆก็ได้:
[freeai prompt="Write a 100-word product description for organic coffee"]
ใช้กรณีสำหรับ WordPress
- สร้างคำอธิบาย SEO สำหรับบทความอัตโนมัติ
- สร้างภาพด้วย AI เพื่อใช้เป็นภาพที่แนะนำ
- แปลบทความเป็นหลายภาษาโดยอัตโนมัติ
- เพิ่มเสียงคำพูดเข้าไปในบทความ
- AI chatbot สำหรับผู้เข้าชม
- เนื้อหาสรุปสำหรับบทความแบบยาว