Contributors: troytempleman
Donate link: https://www.buymeacoffee.com/troytempleman
Tags: latest posts, recent posts, posts, block, carousel
Requires at least: 6.0
Tested up to: 6.6.2
Stable tag: 0.1.3
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
A block that displays posts in a list, grid or carousel.
Posts Block Lite adds a Posts block to the block editor inserter that can be added to display posts in a list, grid or carousel.
Upgrade to Pro at https://troytempleman.com/wordpress/blocks/posts-block/.
- Responsive
- Settings
- Block alignment
- Layout
- List
- Grid
- Carousel
- Text alignment
- Post type [Pro]
- Number of posts
- Order by
- Order
- Number of columns
- Column gutter width
- Display featured image
- Display title
- Add heading to title
- Title heading
- Display author
- Display date
- Display excerpt
- Maximum number of words in excerpt
- Display content
- Display link
- Link text
- Carousel
- Display dots
- Display arrows
- Infinite
- Speed
- Slides to show
- Slides to scroll
- Styles
- Color
- Text
- Background
- Link
- Carousel dots [Pro]
- Carousel dots hover [Pro]
- Carousel arrows [Pro]
- Carousel arrows hover [Pro]
- Typography
- Font family
- Font size
- Appearance
- Line height
- Letter spacing
- Text decoration
- Letter case
- Dimensions
- Padding
- Margin
- List post padding [Pro]
- List post margin [Pro]
- Grid post padding [Pro]
- Grid post margin [Pro]
- Carousel post padding [Pro]
- Carousel post margin [Pro]
- Featured image padding [Pro]
- Featured image margin [Pro]
- Title padding [Pro]
- Title margin [Pro]
- Meta padding [Pro]
- Meta margin [Pro]
- Excerpt padding [Pro]
- Excerpt margin [Pro]
- Content padding [Pro]
- Content margin [Pro]
- Link padding [Pro]
- Link margin [Pro]
- Color
- Variations [Pro]
- List [Pro]
- Grid [Pro]
- Carousel [Pro]
https://troytempleman.com/wordpress/blocks/posts-block/
Posts Block Lite will output a Posts block with the following HTML structure:
<ul class="wp-block-tt-posts wp-block-tt-posts-6">
<li class="wp-block-tt-posts-post">
<div class="wp-block-tt-posts-post-featured-image”>
<img class=“wp-block-tt-posts-post-thumbnail” src=“#”>
</div>
<h3 class="wp-block-tt-posts-post-title">
<a href=“#”>Title</a>
</h3>
<div class="wp-block-tt-posts-post-meta">
<span class="wp-block-tt-posts-post-meta-date">Posted <time class="wp-block-tt-posts-post-meta-date-time" datetime="2023-11-01T12:00:00+00:00">November 1, 2023</time></span>
</div>
<div class="wp-block-tt-posts-post-excerpt">Excerpt</div>
<a class="wp-block-tt-posts-post-link" href=“#”>Read more</a>
</li>
</ul>
If you need help with Posts Block Lite, please submit a ticket on the Support forum.
If you like Posts Block Lite and would like to support it's future development, how about buying me a coffee?
If you would like to contribute to the development of Posts Block Lite, the repository is located on GitHub.
Posts Block Lite is released under the GNU General Public License, version 2 (GPLv2).
- WordPress 6.0 or greater
- PHP version 7.4 or greater
- MySQL version 5.7 or greater or MariaDB version 10.3 or greater.
Posts Block Lite can be installed in one of the following four ways:
To install with the built-in plugin installer:
- Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
- On the Dashboard page, in the left menu, click Plugins.
- On the Plugins page, click Add New Plugin.
- On the Add Plugins page, in the Search plugins... field, type Posts Block Lite.
- In the Search Results, locate Posts Block Lite, click Install Now and Activate.
To install with a .zip file:
- Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
- On the Dashboard page, in the left menu, click Plugins.
- On the Plugins page, click Add New Plugin.
- On the Add Plugins page, click Upload Plugin.
- Click Choose File, locate the .zip file and click Open.
- Click Install Now.
- On the Installing Plugin from uploaded file page, click Activate.
To install with a SFTP client:
- If you have a .zip file, unzip it with archiving software such as WinZip or Archive Utility.
- In a SFTP client such as WinSCP or FileZilla, connect to your WordPress site directory on your server.
- In the unzipped files, copy the posts-block-lite folder and paste on your server, in your site’s wp-content/plugins folder.
- Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
- On the Dashboard page, in the left menu, click Plugins.
- On the Plugins page, locate Posts Block Lite and click Activate.
To install in your theme instead of a plugin:
-
If you have a .zip file, unzip it with archiving software such as WinZip or Archive Utility.
-
In the unzipped files, copy the posts-block-lite folder and paste in your site’s theme folder, such as wp-content/themes/your-theme/inc/posts-block-lite/, where your-theme is your theme folder.
-
In the unzipped files, copy the posts-block-lite folder and paste in your site’s theme folder, such as wp-content/themes/your-theme/inc/posts-block-lite/, where your-theme is your theme folder.
-
In a code editor such as Visual Studio Code or Notepad++, open your theme's functions.php file.
-
In your functions.php file, add the path from Step 2, such as require get_stylesheet_directory() . '/inc/posts-block-lite/posts-block-lite.php';.
-
Save and close your functions.php file.
Posts are dynamic and time-based content typically used for blogs, news, events, etc. Posts are usually listed in reverse chronological order, can be tagged, categorized and commented on.
Please see Installation section.
- Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
- On the Dashboard page, in the left menu, click Posts or Pages.
- On the Posts or Pages page, either click Add New, search for and/or click the desired post or page title.
- In the block editor, either:
- Click the block inserter + icon in the top toolbar
- Click the block inserter + icon to the right of an empty block, or
- Click the block inserter + icon between blocks
- In the block inserter pop-up modal window, search for and/or click Posts to add a Posts block.
- Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
- On the Dashboard page, in the left menu, click Posts or Pages.
- On the Posts or Pages page, search for and/or click the desired post or page title.
- In the block editor, click the desired Posts block.
- In the block toolbar above, select the desired block alignment, layout, text formatting and/or other options.
- In the settings sidebar, in the Block tab:
- In the Settings tab, select the desired settings.
- In the Styles tab, select the desired Color, Typography and/or Dimensions settings.
- Install WordPress on a local server such as Local, Docker, MAMP or XAMPP.
- To install Posts Block Lite on your local site, see Installation section.
- If node.js is not already installed locally, go to https://nodejs.org/ to install.
- In a Command Line Interface (CLI) such as Command Prompt or Terminal, navigate to the posts-block-lite folder. For example, cd localhost/your-site/wp-content/plugins/posts-block-lite.
- To install project dependencies, type npm install.
- In the posts-block-lite folder, edit the desired file or files.
- To create or update the production build directory, type npm run build. For other commands, type npm run.
- Posts block added from the block inserter.
- Posts block variations [Pro].
- Posts block with default settings.
- Posts block with list view settings.
- Posts block with grid view settings.
- Posts block with carousel settings.
- Posts block on the front end.
- Added: Translators in
src/render.php. - Updated: Version in
build/block.jsonandsrc/block.json. - Updated: Version in
package.jsonandposts-block-lite.php. - Updated: Stable tag and changelog in
readme.mdandreadme.txt.
- Changed: Text domains from
posts-blocktoposts-block-lite. - Changed:
json_encodetoesc_attr( wp_json_encode )inbuild/render.phpandsrc/render.php. - Changed:
wp_kses_postfilter from$poststo$contentinbuild/render.phpandsrc/render.php. - Updated: Version in
build/block.jsonandsrc/block.json. - Updated: Version in
package.jsonandposts-block-lite.php. - Updated: Stable tag and changelog in
readme.mdandreadme.txt.
- Added: Code to prevent direct file access in
build/render.phpandsrc/render.php. - Added: Security improvement by adding
wp_kses_postfilter to$block_contentin build/render.phpandsrc/render.php`. - Changed: Function names from
posts_block_*toposts_block_lite_*inposts-block-lite.php. - Changed: Text domains from
posts-block-litetoposts-block. - Removed:
src/slick/config.rb - Updated: Version in
build/block.jsonandsrc/block.json. - Updated: Version in
package.jsonandposts-block-lite.php. - Updated: Stable tag and changelog in
readme.mdandreadme.txt.
- Initial release