Hello, I have this code below that inserts a post in Wordpress.
In addition to the title, I would like to insert a highlighted image, does anyone know how to do this?
Follow the code below that 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);
?>