0
Hello I’m with this code below that inserts a post in Wordpress.
In addition to the title, I would like to insert a highlighted image someone knows how to do this ?
Follow the code below I’m using:
<form action="" method="post">
<input name="Nome" value="Titulo do post">
<input type="file">
<button type="submit">Enviar</button>
</form>
<?php
$my_post = array(
'post_type' => 'post',
'post_status' => 'publish',
'post_title' => $_POST['Nome'],
);
$post_id = wp_insert_post($my_post);
?>
You want to show image when selecting ?
– Matheus Miranda
Matheus would like to select
– Hemerson Prestes
After selecting, show photo ?
– Matheus Miranda
Then insert in the post in the Wordpress panel as highlighted image
– Hemerson Prestes
Sorry, I was getting something else ...
– Matheus Miranda