开发者 | jeherve |
---|---|
更新时间 | 2024年11月12日 15:08 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 6.7 |
jeherve_post_embed
shortcode to embed posts from your site or others' anywhere on your site.
When creating the shortcode, you can use any of the 20 shortcode parameters to make sure the embed will include the posts you want to display, and will look the way you want it to look.
Important: You can only pull posts from 3 different types of sites:
wpapi="true"
to your shortcode parameters.jeherve_post_embed
shortcode.jeherve_post_embed
shortcode includes different parameters, listed below:
url
:wpapi
:false
.true
to retrieve posts from a site using the WP REST API plugin.ignore_sticky_posts
:false
.true
or false
to decide whether you want the embedded post list to include sticky posts.include_images
:true
.true
, if the posts include a Featured Image, it will be displayed above the post.include_title
:true
.include_excerpt
:true
.include_content
:false
.include_credits
:true
.image_size
:include_images
to true.width,height
, width
and height
being the value in pixels.$content_width
value (reference).order
:DESC
.order_by
:modified
(date modified), title
,comment_count
, ID
, date
.date
.date
, relevance
, id
, include
, title
, slug
.number
:20
.before
:after
:tag
:category
:type
:posts
, use any
to query for both posts and pages.exclude
:author
:wrapper_class
:headline
:h3
, before the post list.Yes, you can use the do_shortcode
function to do so. You can read more about it here.
We cannot load blog data at this time
.See the instructions here.
Yes! The plugin includes quite a few filters you can use to customize the post list. You can browse the plugin's source code to find out more.
jeherve_post_embed_blog_id
allows you to specify a custom blog ID or normalized Jetpack or WordPress.com site URL.jeherve_post_embed_base_api_url
allows you to specify another REST API URL where you'll get your posts from. It defaults to the WordPress.com REST API.jeherve_post_embed_query_url
allows you to change the final URL (including the options you've set in the shortcode parameters) used to query posts.jeherve_post_embed_post_loop
allows you to build your own post loop from the data you get from the API.jeherve_post_embed_image_params
allows you to specify custom Photon parameters applied to the Featured Images. It accepts an array of parameters. The accepted parameters are available here.jeherve_post_embed_article_layout
allows you to filter the layout of a single article in the list.jeherve_post_embed_featured_image
allows you to replace the Featured Image used for each post.jeherve_post_embed_posts_cache
allows you to control how long the post list is cached.jeherve_post_embed_featured_cache
allows you to control how long the featured images are cached.jeherve_post_embed_term_cache
allows you to control how long the terms are cached.media
endpoint from the WP REST API to grab the featured image when available.jeherve_post_embed_featured_image
.embed-grid
.wpapi
shortcode parameter.