Free.ai WordPress Plugin
AI tools for WordPress. Content generation, images, and more.
Free.ai pou WordPress
Ajoute jenerasyon kontni AI-powered, kreyasyon imaj, tèks-a-parole, ak tradiksyon dirèkteman nan sit WordPress ou a lè l sèvi avèk shortcodes ak REST API nou an.
Quick Start: Enkòpore Widget la
Yon fason rapid pou ajoute AI sou sit WordPress ou. Koupe sa a nan nenpòt paj, pòs, oswa widgets ki itilize editè HTML:
<script src="https://free.ai/widget.js" data-tool="chat"></script>
Sa ajoute yon entèfas chat AI nan paj ou. Gade Page Widget pou tout zouti ki disponib.
Kode kout Custom (PHP)
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' => 'qwen2.5-72b'], $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');
Lè sa a, itilize li nan nenpòt pòs oswa paj:
[freeai prompt="Write a 100-word product description for organic coffee"]
Ka itilize pou WordPress
- Auto-genè SEO meta dekri pou posts
- Kreyasyon imaj AI-powered pou imaj ki nan lis
- Tradiksyon posts nan plizyè lang otomatikman
- Ajoute son tèks-a-vokal nan atik yo
- AI chatbot pou sipò vizitè
- Konte rezime pou atik long-fòm