=== 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.8
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Transform your website with beautiful infinite scroll functionality. Professional AJAX loading, smart caching, and seamless user experience.
== Description ==
**Revolutionize your website's content browsing with seamless infinite scroll that keeps visitors engaged!**
FYP Infinite Posts is a professional WordPress plugin that transforms your traditional pagination into a smooth, modern infinite scrolling experience. With intelligent AJAX loading, smart caching, and comprehensive customization options, this plugin delivers both exceptional performance and user satisfaction.
Built for flexibility and performance, FYP Infinite Posts features context-aware content filtering, multiple loading strategies, and a professional admin interface that makes configuration simple yet powerful. Whether you're running a blog, news site, portfolio, or any content-driven website, this plugin provides the tools you need for a superior browsing experience.
**Why Choose FYP Infinite Posts?**
**Seamless User Experience** – Smooth AJAX loading eliminates page refreshes and keeps users engaged
**Performance Optimized** – Smart transient caching system (15-minute cache) reduces database queries
**Context-Aware Intelligence** – Automatically detects categories, taxonomies, and author pages for relevant content
**Multiple Loading Methods** – Choose between infinite scroll, load more button, or no pagination
**Professional Admin Interface** – Comprehensive settings panel under FYPlugins → Infinite Posts
**Theme Integration** – Works seamlessly with any WordPress theme and post type
**Developer-Friendly** – Clean code, custom templates, and extensible architecture
**Translation Ready** – Internationalization support with .pot file included
**Key Features:**
– **Smart Loading Options:** Infinite scroll, load more button, or static display with configurable behavior
– **Intelligent Caching:** 15-minute WordPress transient caching improves performance and reduces server load
– **Context-Aware Filtering:** Automatic category, taxonomy, tag, and author detection on archive pages
– **Complete Content Control:** Support for all post types including custom post types and WooCommerce products
– **Flexible Display Options:** Configurable posts per page, offset, ordering, and custom messages
– **Multiple Sort Options:** Date, title, random, last modified, and menu order sorting with ASC/DESC options
– **Powerful Shortcode:** `[fyplugins_infinite_posts]` with extensive customization parameters
– **Responsive Design:** Mobile-optimized loading animations and touch-friendly interface
– **Professional Admin Settings:** Clean interface for default configuration and global options
– **Secure & Reliable** – Proper nonce verification, data sanitization, and error handling
– **Custom Template System:** Override default templates for complete design control
– **Cache Management:** Automatic cache invalidation when posts are updated or published
– **Clean Uninstall:** Properly removes all options and cached data when uninstalled
This plugin is part of the FYPlugins ecosystem, designed to provide high-quality WordPress solutions with exceptional performance and user experience.
== 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 ==
**Infinite Posts Shortcode – `[fyplugins_infinite_posts]`**
`pagination` string (default: scroll or Set in settings) Loading method: `scroll` (infinite scroll), `button` (load more button), `none` (static display)
`posts_per_page` integer (default: 10 or Set in settings) Number of posts to load per batch
`offset` integer (default: 0 or Set in settings) Number of posts to skip for the first batch
`post_type` string (default: post or Set in settings) Post type to display (post, page, product, or any custom post type)
`category` string|boolean (default: true or Set in settings) Category filter: true (auto-detect), false (ignore), or specific category ID
`taxonomy` string|boolean (default: true or Set in settings) Taxonomy filter: true (auto-detect), false (ignore), or specific taxonomy name
`author` string|boolean (default: true or Set in settings) Author filter: true (auto-detect), false (ignore), or specific author ID
`order` string (default: DESC or Set in settings) Sort order: `ASC` (ascending) or `DESC` (descending)
`orderby` string (default: date or Set in settings) Sort field: `date`, `title`, `rand`, `modified`, `menu_order`
`btn_text` string (default: "Load More" or Set in settings) Custom text for the load more button
`end_message` string (default: "No more posts to load." or Set in settings) Message when all posts are loaded
`class` string (default: Empty or Set in settings) Additional CSS classes for styling
**Advanced Examples:**
“`
// Different post types with custom styling
[fyplugins_infinite_posts post_type="product" class="shop-grid"]
[fyplugins_infinite_posts post_type="portfolio" pagination="button" class="portfolio-masonry"]
// 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"]
[fyplugins_infinite_posts taxonomy="product_category" posts_per_page="8"]
// Load more button with custom text
[fyplugins_infinite_posts pagination="button" btn_text="Show More Articles" end_message="That's all folks!"]
// Random posts with no pagination
[fyplugins_infinite_posts orderby="rand" pagination="none" posts_per_page="6"]
// Multiple instances on same page
[fyplugins_infinite_posts post_type="news" class="news-section"]
[fyplugins_infinite_posts post_type="events" 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)
== 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 template** from `/wp-content/plugins/fyp-infinite-posts/includes/templates/post-item.php`
3. **Create custom templates** for specific post types:
– `post-item.php` – For blog posts
– `page-item.php` – For pages
– `product-item.php` – For WooCommerce products
– `portfolio-item.php` – For portfolio items
– `{post-type}-item.php` – For any custom post type
**Template Hierarchy:**
1. Child theme: `/wp-content/themes/child-theme/fyplugins/infinite-posts/{post-type}-item.php`
2. Parent theme: `/wp-content/themes/parent-theme/fyplugins/infinite-posts/{post-type}-item.php`
3. Plugin template: `/wp-content/plugins/fyp-infinite-posts/includes/templates/{post-type}-item.php`
4. Default fallback: `/wp-content/plugins/fyp-infinite-posts/includes/templates/default-item.php`
**Template Examples:**
**Modern Card Layout:**
“`php
“`
**Minimal List Layout:**
“`php
“`
**Available Template Variables:**
All standard WordPress template functions are available in your custom templates:
– `the_title()`, `get_the_title()`
– `the_content()`, `the_excerpt()`
– `the_permalink()`, `get_permalink()`
– `the_post_thumbnail()`, `has_post_thumbnail()`
– `the_author()`, `get_the_author()`
– `the_date()`, `get_the_date()`
– `the_category()`, `get_the_category()`
– `the_tags()`, `get_the_tags()`
– Plus all custom fields and metadata
== Installation ==
**Automatic Installation (Recommended)**
1. Login to your WordPress admin dashboard
2. Navigate to **Plugins → Add New**
3. Search for **"FYP Infinite Posts"**
4. Click **"Install Now"** and then **"Activate"**
**Manual Installation**
1. Download the plugin ZIP file
2. Upload to `/wp-content/plugins/fyp-infinite-posts/` directory
3. Activate the plugin through the **Plugins** menu in WordPress
**Configuration Setup**
1. **Configure default settings:** Go to **WordPress Admin → FYPlugins → Infinite Posts**
2. **Set your preferences:** Choose pagination type, posts per page, post types, and sorting options
3. **Start using:** Add `[fyplugins_infinite_posts]` shortcode anywhere on your site
**Quick Test**
Add `[fyplugins_infinite_posts posts_per_page="3"]` to any post or page to test the plugin immediately!
== Frequently Asked Questions ==
= Does this plugin work with any theme? =
**Absolutely!** FYP Infinite Posts is designed to work flawlessly with all WordPress themes. The plugin uses semantic HTML and minimal CSS that adapts to your theme's styling. It includes a powerful template system for complete design control and works perfectly with popular themes like Astra, GeneratePress, OceanWP, and more.
= What pagination options are available? =
**Three flexible loading methods:**
– **Infinite Scroll:** Automatically loads posts as users scroll down (default)
– **Load More Button:** Users click a button to load additional posts
– **None:** Static display without pagination (useful for showing specific post sets)
= How does the caching system work? =
**Smart and automatic!** The plugin uses WordPress transients to cache query results for exactly 15 minutes (900 seconds). This dramatically improves loading times and reduces database queries. The cache automatically clears when posts are updated, published, or deleted, ensuring fresh content.
= What is context-aware filtering? =
**Intelligent content detection!** When you use `category="true"`, `taxonomy="true"`, or `author="true"`, the plugin automatically detects the current page context:
– On category pages: Shows posts from that category
– On tag pages: Shows posts with that tag
– On author pages: Shows posts by that author
– On taxonomy pages: Shows posts from that taxonomy
– On regular pages: Shows all posts
= Can I use it with custom post types? =
**Yes, unlimited support!** The plugin works with all public post types including:
– WordPress Posts and Pages
– WooCommerce Products
– Custom Post Types (Portfolio, Events, Testimonials, etc.)
– Any post type created by themes or plugins
= Can I customize how posts are displayed? =
**Extensively!** You have complete control over post display:
– Override templates for any post type
– Custom CSS classes for unique styling
– Control which elements to show (title, excerpt, thumbnail, etc.)
– Multiple layout options through template customization
= Does it affect my site's performance? =
**Minimal impact, maximum performance!** FYP Infinite Posts is optimized for speed:
– Smart transient caching (15-minute duration)
– Lightweight CSS file (under 2KB)
– Efficient AJAX requests with nonce security
– Clean, optimized PHP code following WordPress standards
– Automatic cache invalidation when content changes
= Is it mobile-friendly? =
**100% responsive!** The plugin includes:
– Mobile-optimized infinite scroll detection
– Touch-friendly load more buttons
– Responsive loading animations
– Adaptive layouts that work on all screen sizes
= Can I have multiple instances on the same page? =
**Absolutely!** You can use multiple shortcodes with different configurations:
– Different post types per section
– Unique styling with CSS classes
– Separate pagination settings
– Independent filtering options
= What happens if JavaScript is disabled? =
**Graceful degradation!** If JavaScript is disabled:
– The initial posts still display normally
– Users can still access content
– No JavaScript errors or broken functionality
– SEO and accessibility remain intact
= How do I show posts from specific categories? =
**Multiple ways:**
– **Auto-detect:** `category="true"` (detects current category page)
– **Specific category:** `category="5"` (shows posts from category ID 5)
– **Ignore categories:** `category="false"` (shows all posts regardless of category)
= Is it developer-friendly? =
**Absolutely!** The plugin features:
– Clean, documented PHP code following WordPress standards
– PSR-4 autoloading with proper namespacing
– Template override system for complete customization
– Translation-ready with .pot file included
– Comprehensive hooks and filters for customization
– Proper uninstall cleanup
= Does it work with SEO plugins? =
**Perfect compatibility!** The plugin works seamlessly with:
– Yoast SEO
– RankMath
– All in One SEO
– Other popular SEO plugins
– Maintains proper meta tags and structured data
= Is it secure? =
**Enterprise-level security!** Features include:
– WordPress nonce verification for all AJAX requests
– Proper data sanitization and validation
– Secure database queries with prepared statements
– No direct file access or security vulnerabilities
== Screenshots ==
1. **Beautiful Infinite Scroll in Action** – Smooth loading animation with elegant spinner as users scroll down the page
2. **Custom template* – Post list made easily customizable with templates.
3. **Comprehensive Admin Settings** – Professional configuration panel with default settings and global options under FYPlugins → Infinite Posts
== Changelog ==
= 1.1.0 – Performance & Features Enhancement =
- **Added:** Comprehensive admin settings panel at FYPlugins → Infinite Posts
- **Added:** Author filtering support with context-aware detection on author archive pages
- **Added:** `author` parameter for shortcode with context-aware author detection
- **Added:** Additional sorting options including modified date and menu order
- **Added:** Enhanced template system with improved template hierarchy and fallbacks
- **Added:** Smart cache invalidation hooks for automatic performance optimization
- **Added:** Automatic cache clearing when posts are updated, published, or deleted
- **Inproved:** Enhanced transient caching system with 15-minute duration for optimal performance
- **Inproved:** Optimized database queries with improved query argument handling
- **Inproved:** Memory-efficient code with better resource management
- **Inproved:** Code organization with PSR-4 autoloading and proper namespacing
- **Inproved:** Error handling with graceful degradation
- **Updated:** Translation files with new strings
= 1.0.2 – Caching & Taxonomy Support =
- **Added:** Request caching for better performance and reduced database load
- **Added:** Comprehensive taxonomies support for custom post types
- **Added:** `taxonomy` parameter to shortcode for advanced content filtering
- **Fixed:** Category detection not always working correctly on archive pages
- **Improved:** Query optimization for better performance on large sites
= 1.0.1 – Styling Enhancement =
- **Added:** `class` parameter to shortcode for custom CSS styling and layout control
- **Improved:** CSS structure for better theme compatibility
- **Enhanced:** Documentation with additional usage examples
= 1.0.0 – Initial Release =
- Beautiful infinite scroll functionality with smooth AJAX loading
- Customizable shortcode `[fyplugins_infinite_posts]` with multiple parameters
- Support for all public post types including custom post types
- Multiple pagination options: infinite scroll, load more button, or none
- Template override system for complete design control
- Lightweight CSS and JavaScript with minimal impact on site speed
- Secure AJAX implementation with proper nonce verification
== Roadmap & Future Enhancements ==
- Advanced filtering options with multiple taxonomy combinations
- Search integration for filtered infinite scroll results
- Date range filtering for time-based content organization
- Custom meta field filtering for advanced content queries
- Gutenberg block for visual editor integration with live preview
- Widget support for sidebar and footer placement
- Enhanced loading animations and transition effects
- Multiple layout templates (grid, masonry, list, card views)
- Loading performance analytics and optimization suggestions
- User engagement tracking for scroll behavior analysis
- Advanced caching options with configurable duration
- Background post preloading for even faster user experience
- WooCommerce integration with product variations support
- Multi-site network compatibility and centralized settings
- Import/export functionality for settings and templates
- Advanced developer hooks and filter system
- Enhanced accessibility features with full WCAG compliance
- Progressive Web App (PWA) compatibility
- Offline reading capabilities with service worker integration
- Voice navigation support for accessibility
**💡 Have Feature Ideas?**
We welcome feedback and feature requests! Contact us through the [WordPress support forum](https://wordpress.org/support/plugin/fyp-infinite-posts/) or visit [francoisyerg.net](https://francoisyerg.net) for direct contact.