开发者 | bangerkuwranger |
---|---|
更新时间 | 2013年11月10日 06:52 |
捐献地址: | 去捐款 |
PHP版本: | 3.1 及以上 |
WordPress版本: | 3.7.1 |
版权: | MIT |
版权网址: | 版权信息 |
showimage
with either hide
or show
. It's pretty easy!
For fun, I decided to also build a widget that does the same thing; it's included and can be used like any other widget. Why not?!
tekservesinglepostshortcode
folder to the /wp-content/plugins/
directory[single_post id="1" showimage="show"]
.You want to display a link to a single post with a brief content preview. Plenty of plugins will create this type of object in a list, or as part of popular or related posts, but sometimes you want to manually feature a post somewhere and not mess around with sticky posts or the loop. This simple shortcode does it for you without modifying your theme's functions.php. You also get a widget, so there's that!
It's pretty easy; just add css for the output classes and ids in your style.css for your theme, or enqueue a separate .css file in your theme to handle it. Here's a listing of targets to style the output: Output to Style CSS target Single Post Container .tekserve-single-post -or- #single-post-$$ ( $$ is numerical post id) Featured Image .tekserve-single-post a img Title .tekserve-single-post .tekserve-single-post-title Date and Author .tekserve-single-post .tekserve-single-post-meta Post Content .tekserve-single-post .tekserve-single-post-excerpt
From the post, of course! Here are the specifics: