开发者 |
idenovasi
satrya |
---|---|
更新时间 | 2023年7月31日 13:43 |
捐献地址: | 去捐款 |
PHP版本: | 7.2 及以上 |
WordPress版本: | 6.1 |
版权: | GPLv3 or later |
版权网址: | 版权信息 |
Explanation of shortcode options:
Basic shortcode
[rpwe]
Display 10 recent posts
[rpwe limit="10"]
Display 5 random posts
[rpwe limit="5" orderby="rand"]
Display 10 recent posts without thumbnail
[rpwe limit="10" thumb="false"]
Open post link in new tab
[rpwe link_target="true"]
Disable default style
[rpwe styles_default="false"]
Here are the full default shortcode arguments ` limit="5" offset="" order="DESC" orderby="date" post_type="post" cat="" tag="" taxonomy="" post_type="post" post_status="publish" ignore_sticky="1" taxonomy="" post_title="true" link_target="false" excerpt="false" length="10" thumb="true" thumb_height="45" thumb_width="45" thumb_default="https://via.placeholder.com/45x45/f0f0f0/ccc" thumb_align="rpwe-alignleft" date="true" readmore="false" readmore_text="Read More »" styles_default="true" css_id="" css_class="" before="" after="" `
You can use rpwe_default_query_arguments
to filter it. Example:
add_filter( 'rpwe_default_query_arguments', 'your_custom_function' ); function your_custom_function( $args ) { $args['posts_per_page'] = 10; // Changing the number of posts to show. return $args; }
Did you installed any Post or Post Type Order? Please try to deactivate it and try again the ordering. (related question)
Your theme needs to support Post Thumbnail, please go to http://codex.wordpress.org/Post_Thumbnails to read more info and how to activate it in your theme.
First, please uncheck the Use Default Style option then place the css code below on the Additional CSS panel on Customizer, then you can customize it to fit your needs
.rpwe-block ul { list-style: none !important; margin-left: 0 !important; padding-left: 0 !important; } .rpwe-block li { border-bottom: 1px solid #eee; margin-bottom: 10px; padding-bottom: 10px; list-style-type: none; } .rpwe-block a { display: inline !important; text-decoration: none; } .rpwe-block h3 { background: none !important; clear: none; margin-bottom: 0 !important; margin-top: 0 !important; font-weight: 400; font-size: 12px !important; line-height: 1.5em; } .rpwe-thumb { border: 1px solid #eee !important; box-shadow: none !important; margin: 2px 10px 2px 0; padding: 3px !important; } .rpwe-summary { font-size: 12px; } .rpwe-time { color: #bbb; font-size: 11px; } .rpwe-alignleft { display: inline; float: left; } .rpwe-alignright { display: inline; float: right; } .rpwe-aligncenter { display: block; margin-left: auto; margin-right: auto; } .rpwe-clearfix:before,.rpwe-clearfix:after { content: ""; display: table !important; } .rpwe-clearfix:after { clear: both; } .rpwe-clearfix { zoom: 1; }
I know it's not good but I have a good reason, the !important
is to make sure the built-in style compatible with all themes. But if you don't like it, you can turn of the Use Default Styles and remove all custom css code in the Custom CSS box then create your own style.
Default arguments
rpwe_default_args
Post excerpt
rpwe_excerpt
Post markup
rpwe_markup
Post query arguments
rpwe_default_query_arguments
display: block
for the list, inline-block
causing issue for some websites.display: inline-block;
to the default style, to make sure each list align properly. Thank you outrospective!cssID
or cssid
, please use css_id
instead.before
and after
shortcode attribute move to inside the recent posts container.rpwe-frontend.css
will be loaded if shortcode or widget present.extract()
. reftrue
or false
shortcode value.