=== FYP Infinite Posts ===
Contributors: francoisyerg
Donate link: https://buymeacoffee.com/francoisyerg
Tags: infinite scroll, ajax, posts, load more, pagination
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Advanced infinite scroll with 8 professional templates, smart caching, context-aware filtering, and complete customization control.
== Description ==
**Transform your WordPress content display with professional infinite scroll and 8 stunning templates!**
FYP Infinite Posts is a powerful WordPress plugin that replaces traditional pagination with smooth, modern infinite scrolling. Featuring intelligent AJAX loading, advanced template layouts, smart caching, and context-aware filtering, it delivers exceptional performance and user engagement for any content-driven website.
**Core Features:**
= 8 Professional Template Layouts =
* **Default (Full Width)** – Clean single-column layout for blogs
* **Grid 2/3/4 Columns** – Responsive multi-column grids for galleries and portfolios
* **Slider/Carousel** – Horizontal scrolling with touch support
* **Masonry Layout** – Pinterest-style staggered grid
* **Card Layout** – Modern card design with hover effects
* **List View** – Minimal text-focused display
= Smart Loading Methods =
* **Infinite Scroll** – Automatically loads posts as users scroll (vertical or horizontal for sliders)
* **Load More Button** – Manual loading with customizable button text
* **Static Display** – Show posts without pagination
* Intersection Observer API for efficient scroll detection
= Context-Aware Filtering =
Automatically detects and filters content based on:
* Category archive pages
* Tag archive pages
* Custom taxonomy pages
* Author archive pages
* Maintains context across AJAX loads
= Performance Optimization =
* **Smart Transient Caching** – 15-minute query caching reduces database load
* **Automatic Cache Invalidation** – Clears cache when posts are modified, deleted, or published
* **Conditional CSS Loading** – Only loads styles for templates in use
* **Optimized Tax Queries** – Efficient taxonomy filtering with category fallback
* **Memory Efficient** – No found_rows when not needed
= Advanced Display Controls =
Granular control over post elements via admin panel or shortcode:
* Featured images/thumbnails
* Categories and taxonomies
* Publication dates
* Author names
* Post excerpts with configurable length (1-200 words)
* Comments count
= Developer-Friendly Architecture =
* **Template Override System** – 10-level hierarchy for maximum flexibility
* **Post-Type Specific Templates** – `{post-type}-{template}-item.php` naming convention
* **PSR-4 Autoloading** – Clean namespaced code structure
* **Secure AJAX** – Proper nonce verification and data sanitization
* **Translation Ready** – Full internationalization support
* **Extensible Hooks** – WordPress standard action and filter hooks
= Professional Admin Interface =
* Settings tab for default behavior configuration
* Template tab for design customization
* Help tab with comprehensive documentation
* Real-time preview of available templates
* Support for all public post types
= Complete Post Type Support =
Works with all public WordPress post types:
* Standard posts and pages
* WooCommerce products
* Custom post types (portfolios, events, testimonials)
* Any theme or plugin post types
**Perfect For:**
* Blogs and news websites
* WooCommerce product catalogs
* Portfolio and gallery websites
* Event listings
* Magazine-style content sites
* Any content-driven WordPress website
Part of the FYPlugins ecosystem – professional WordPress solutions with exceptional performance.
== Usage ==
**Quick Start:**
1. **Install and activate** the FYP Infinite Posts plugin
2. **Configure default settings** at WordPress Dashboard FYPlugins Infinite Posts
3. **Add infinite scroll anywhere** using the `[fyplugins_infinite_posts]` shortcode
**Basic Examples:**
“`
[fyplugins_infinite_posts]
[fyplugins_infinite_posts pagination="button" posts_per_page="5"]
[fyplugins_infinite_posts post_type="product" category="featured"]
“`
**Advanced Examples:**
“`
[fyplugins_infinite_posts pagination="scroll" orderby="rand" class="custom-layout"]
[fyplugins_infinite_posts post_type="portfolio" taxonomy="portfolio_category" author="true"]
“`
== Shortcode Parameters ==
= Main Shortcode: [fyplugins_infinite_posts] =
All parameters are optional and default to admin panel settings.
= Loading & Behavior =
* **pagination** – Loading method: `scroll`, `button`, or `none` (default: scroll)
* **posts_per_page** – Posts per batch (default: 10)
* **offset** – Posts to skip initially (default: 0)
= Content Filtering =
* **post_type** – Post type: `post`, `page`, `product`, or custom (default: post)
* **category** – Category: `true` (auto-detect), `false`, or category ID
* **taxonomy** – Taxonomy: `true` (auto-detect), `false`, or taxonomy name
* **term** – Term ID when using specific taxonomy
* **author** – Author: `true` (auto-detect), `false`, or author ID
= Sorting =
* **orderby** – Sort by: `date`, `title`, `rand`, `modified`, `menu_order` (default: date)
* **order** – Order: `ASC` or `DESC` (default: DESC)
= Display Template =
* **template** – Layout: `default`, `grid-2`, `grid-3`, `grid-4`, `slider`, `masonry`, `card`, `list`
= Element Visibility =
* **show_thumbnail** – Show featured image: `true` or `false` (default: true)
* **show_categories** – Show categories: `true` or `false` (default: true)
* **show_date** – Show date: `true` or `false` (default: true)
* **show_author** – Show author: `true` or `false` (default: true)
* **show_excerpt** – Show excerpt: `true` or `false` (default: true)
* **show_comments** – Show comments count: `true` or `false` (default: true)
* **excerpt_length** – Excerpt word count: 1-200 (default: 55)
= Customization =
* **btn_text** – Load more button text (default: "Load More")
* **end_message** – No more posts message (default: "No more posts to load.")
* **class** – Additional CSS classes
**Advanced Examples:**
“`
// Modern template layouts with design control
[fyplugins_infinite_posts template="grid-3" show_excerpt="false" show_comments="false"]
[fyplugins_infinite_posts template="card" excerpt_length="25" show_categories="true"]
[fyplugins_infinite_posts template="slider" show_thumbnail="true" show_author="false"]
[fyplugins_infinite_posts template="masonry" show_date="false" class="portfolio-grid"]
// Different post types with custom styling
[fyplugins_infinite_posts post_type="product" template="grid-4" class="shop-grid"]
[fyplugins_infinite_posts post_type="portfolio" template="masonry" pagination="button" class="portfolio-display"]
// Context-aware filtering (automatically detects current page context)
[fyplugins_infinite_posts category="true" taxonomy="true" author="true"]
// Custom filtering and ordering
[fyplugins_infinite_posts category="5" orderby="title" order="ASC" template="list"]
[fyplugins_infinite_posts taxonomy="product_category" posts_per_page="8" template="grid-2"]
// Load more button with custom text and design
[fyplugins_infinite_posts pagination="button" btn_text="Show More Articles" end_message="That's all folks!" template="card"]
// Random posts with no pagination
[fyplugins_infinite_posts orderby="rand" pagination="none" posts_per_page="6" template="slider"]
// Multiple instances on same page with different templates
[fyplugins_infinite_posts post_type="news" template="list" class="news-section"]
[fyplugins_infinite_posts post_type="events" template="card" class="events-section" pagination="button"]
"`
“`
**Context-Aware Intelligence:**
When using `category="true"`, `taxonomy="true"`, or `author="true"`, the plugin automatically detects:
– Category archive pages (shows posts from current category)
– Tag archive pages (shows posts with current tag)
– Custom taxonomy pages (shows posts from current taxonomy term)
– Author archive pages (shows posts from current author)
– Regular pages (shows all posts when no context detected)
**Supported Post Types:**
All public post types including: Posts, Pages, WooCommerce Products, Custom Post Types, Events, Portfolios, Testimonials, and more.
**Sorting Options:**
– **date:** Publication date (newest or oldest first)
– **title:** Alphabetical by post title
– **rand:** Random order (cache disabled for performance)
– **modified:** Last modification date
– **menu_order:** Custom menu order (useful for pages)
== Built-in Template Layouts ==
**Choose from 8 Professional Template Designs**
FYP Infinite Posts comes with beautiful, responsive template layouts that work perfectly with any WordPress theme. Each template is optimized for different content types and use cases.
**Available Templates:**
1. **Default (Full Width)** – Clean, single-column layout perfect for blogs and standard content
2. **Grid 2 Columns** – Balanced two-column grid ideal for portfolios and image-heavy content
3. **Grid 3 Columns** – Popular three-column layout great for product catalogs and galleries
4. **Grid 4 Columns** – Compact four-column display perfect for large content collections
5. **Slider/Carousel** – Horizontal scrolling layout with navigation, perfect for featured content
6. **Masonry Layout** – Pinterest-style staggered grid that adapts to content height variations
7. **Card Layout** – Modern card-based design with shadows and hover effects
8. **List View** – Minimal, text-focused layout perfect for news articles and simple content
**Template Features:**
– **Responsive Design:** All templates adapt beautifully to mobile, tablet, and desktop screens
– **Theme Integration:** Templates inherit your theme's colors, fonts, and styling
– **Customizable Elements:** Control visibility of thumbnails, dates, authors, excerpts, categories, and comments
– **Performance Optimized:** Lightweight CSS with conditional loading per template
– **Post Type Specific:** Each template can be customized for different post types
**Template Usage Examples:**
"`
// Use specific templates for different content types
[fyplugins_infinite_posts template="card" post_type="post"] // Blog posts in card layout
[fyplugins_infinite_posts template="grid-3" post_type="product"] // WooCommerce products in 3-column grid
[fyplugins_infinite_posts template="masonry" post_type="portfolio"] // Portfolio items in masonry style
[fyplugins_infinite_posts template="slider" post_type="testimonial"] // Testimonials in carousel format
[fyplugins_infinite_posts template="list" post_type="news"] // News articles in clean list view
"`
**Design Control Options:**
Configure exactly what elements appear in your templates:
– Toggle featured images/thumbnails on or off
– Show or hide post categories and tags
– Control publication dates and author information
– Customize excerpt length (number of words)
– Enable/disable comments count display
– Add custom CSS classes for unique styling
== Customizing Post Templates ==
**Complete Design Control with Custom Templates**
FYP Infinite Posts provides a powerful template system that gives you complete control over how your posts are displayed. Create stunning, unique layouts that perfectly match your website's design.
**Template Override System:**
1. **Create template directory** in your theme: `/wp-content/themes/your-theme/fyplugins/infinite-posts/`
2. **Copy default templates** from `/wp-content/plugins/fyp-infinite-posts/includes/templates/`
3. **Create custom templates** for specific post types and layouts:
– `{post-type}-{template}-item.php` – For specific post type with specific template (e.g., `post-grid-3-item.php`)
– `default-{template}-item.php` – For specific template, any post type (e.g., `default-card-item.php`)
– `{post-type}-default-item.php` – For specific post type, default template (e.g., `product-default-item.php`)
**Available Template Files to Customize:**
– `default-default-item.php` – Default full-width layout
– `default-grid-2-item.php` – Two-column grid layout
– `default-grid-3-item.php` – Three-column grid layout
– `default-grid-4-item.php` – Four-column grid layout
– `default-slider-item.php` – Slider/carousel layout
– `default-masonry-item.php` – Masonry/Pinterest-style layout
– `default-card-item.php` – Modern card layout
– `default-list-item.php` – Clean list layout
**Enhanced Template Hierarchy (NEW in v1.2.0):**
1. Child theme: `/wp-content/themes/child-theme/fyplugins/infinite-posts/{post-type}-{template}-item.php`
2. Parent theme: `/wp-content/themes/parent-theme/fyplugins/infinite-posts/{post-type}-{template}-item.php`
3. Child theme: `/wp-content/themes/child-theme/fyplugins/infinite-posts/default-{template}-item.php`
4. Parent theme: `/wp-content/themes/parent-theme/fyplugins/infinite-posts/default-{template}-item.php`
5. Child theme: `/wp-content/themes/child-theme/fyplugins/infinite-posts/{post-type}-default-item.php`
6. Parent theme: `/wp-content/themes/parent-theme/fyplugins/infinite-posts/{post-type}-default-item.php`
7. Plugin template: `/wp-content/plugins/fyp-infinite-posts/includes/templates/{post-type}-{template}-item.php`
8. Plugin template: `/wp-content/plugins/fyp-infinite-posts/includes/templates/default-{template}-item.php`
9. Plugin template: `/wp-content/plugins/fyp-infinite-posts/includes/templates/{post-type}-default-item.php`
10. Default fallback: `/wp-content/plugins/fyp-infinite-posts/includes/templates/default-default-item.php`
**Template Examples:**
**Modern Card Layout:**
“`php