cwood821 / posts-to-grid

WordPress plugin to show posts in a grid via a [postgrid ...] shortcode.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Posts-to-Grid

Posts-to-Grid provides access to the WordPress get_posts() function via a shortcode. Posts are outputted as a grid of featured images with the post title as a link below each grid element.

The Shortcode

[postgrid ...]

Besides accepting the arguments listed in the get_posts() default usage example, the shortcode also accepts the following parameters:

cols The number of columns (1-4) that you want the outputted grid to have. Defaults to 3.
height The height of the featured image blocks in the grid, formatted as a CSS value (e.g. '15em', '200px'). Defaults to 15em.
thumbnail_size The size of the featured image shown in each grid block background. Accepts WordPress defaults for [thumbnail sizes](https://codex.wordpress.org/Post_Thumbnails).

Example

[postgrid cols="3" posts_per_page="3" height="15em"]

Future Development

  • Refine responsive image integration
  • Add a WordPress Admin Settings page

License

Copyright © 2017 Christian Wood

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

WordPress plugin to show posts in a grid via a [postgrid ...] shortcode.


Languages

Language:PHP 87.1%Language:CSS 12.9%