wp cli - wp-cli create post and media import

I would like to create a post and insert a url as an image, right now I have this, it works but creates a gallery block,

I would like to create a post and insert a url as an image, right now I have this, it works but creates a gallery block, instead I would just like to create a simple image block . What is the correct syntax to post just an image in "post_content" ?

 wp post create --post_title="test" --post_content="[gallery ids='$(wp media import .jpg --porcelain)']"

Thanks !

I would like to create a post and insert a url as an image, right now I have this, it works but creates a gallery block, instead I would just like to create a simple image block . What is the correct syntax to post just an image in "post_content" ?

 wp post create --post_title="test" --post_content="[gallery ids='$(wp media import https://ring.cdandlp/113719298.jpg --porcelain)']"

Thanks !

Share Improve this question asked May 13, 2019 at 5:05 Finger twistFinger twist 1334 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 3

There is just [gallery] to display images BUT you can specify in which size the image(s) will be displayed. By default it's size='thumbnail'. Simply set it to size='full' to just get one full-sized image:

$ wp post create --post_title="Foobar" --post_content="[gallery ids='$(wp media import https://dummyimage/600x400/000/fff.jpg --porcelain)' size='full']"

More gallery shortcode options can be found on wordpress: https://en.support.wordpress/gallery/#gallery-shortcode

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745499872a4630364.html

相关推荐

  • wp cli - wp-cli create post and media import

    I would like to create a post and insert a url as an image, right now I have this, it works but creates a gallery block,

    5小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信