Free.ai WordPress Plugin
AI tools for WordPress. Content generation, images, and more.
Free.ai ho an'ny WordPress
Ampidiro ao amin'ny tranonkalanao WordPress mivantana ny famoronana votoaty, famoronana sary, lahatsoratra ho teny filamatra, ary ny fandikan-teny amin'ny alalan'ny fampiasana ny shortcodes sy ny API REST.
Fandefasana haingana: Ampidiro ilay widget
Ny fomba haingana indrindra hampidirana AI amin'ny tranonkala WordPress-nao. Apetao amin'ny pejy, lahatsoratra, na widget amin'ny alalan'ny mpanova HTML ity:
<script src="https://free.ai/widget.js" data-tool="chat"></script>
Mampiditra mpanera AI amin'ny pejy io. Jereo ny pejy Widget page ho an'ireo fitaovana misy rehetra.
Fandrindrana tsotra
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');
Avy eo ampiasaina amin'ny lahatsoratra na pejy rehetra:
[freeai prompt="Write a 100-word product description for organic coffee"]
Fampiasana ny WordPress
- Mamorona ny famaritana meta SEO ho an'ny lahatsoratra
- Famoronana sary ho an'ny sary misongadina amin'ny alalan'ny AI
- Dikan-teny
- Hampiditra feo soratra ho teny amin'ny lahatsoratra
- AI chatbot ho an'ny fanohanana ny mpitsidika
- Famintinana ny votoaty ho an'ny lahatsoratra lava