Been using wp-cli which I love. But i'm trying to create new posts with a clickable image and the best wp-cli does with 1 command is a featured image which is not clickable (plus featured images are above my post's title & content).
This command is supposed to create a post with image, but instead it's an empty post (in the backend the image is "uploaded" to the post, but the image is not displayed):
wp media import ./FILENAME --post_id=$(wp post create --post_title='TITLE' --post_status=publish --porcelain)
Is there a fix or a missing option? Again I don't want to use the featured image option since it puts the image above my title/content.
So now I've moved on to 2 commands: Creating the post & then updating the posts' content field/value.
wp post update <ID> --post_content="<a href=""URL-TO-IMAGE""><img class=""size-full"" src=""URL-TO-IMAGE"" /></a>"
The problem with this is that I have to rearrange a bunch of values, so after I run this:
wp media import FILENAME
I'll need to do this:
echo `wp option get siteurl`/wp-content/uploads/`date +%Y`/`date +%m`/FILENAME
and so on
I'm running latest wp-cli & wordpress with the default plugins, so maybe I'm missing a plugin? Thanks.