Code Monkey home page Code Monkey logo

wordpress-ajax-filter-posts's Introduction

WordPress Ajax Filter Posts

Description

A WordPress plugin to filter posts with taxonomies terms and load more posts via Ajax. You can add posts and filters via a shortcode on any page.

[ajax_filter_posts post_type="recipe" tax="meal_type, food_type, diet_type"  posts_per_page="12"]

This plugins uses no dependencies, is translatable and WPML ready.

Parameters

  • post_type Post type to show. Default post.

  • tax A comma seperated list of taxonomies to filter the post by. Default post_term.

  • post_per_page Numbers of maximum posts to retreive at a time. Default 12.

  • multiselect Allow one or more active filters per taxonomy. Defaults to 'true': allow more active filters

Overwriting template files

To easily overwrite template files you can copy one or more of the files in the templates folder to your own theme. Create a folder ajax-filter-posts in the root of your theme directory and copy the files in that newly created folder. Keep in mind that you have to keep the folder structure intact. For example: If you want a custom version of loop.php, you copy the file to <<your-public-folder>>/wp-content/themes/<<your-theme>>/ajax-filter-posts/partials.

Motivation

I build a lot of sites that needed a functionality like this and decided to create a plugin for it. Although there are a lot of plugins doing something like this, they usually add a lot of bloat and are not developer friendly. This plugin is for a developer easier to implement, easier to edit and keeps te codebase cleaner.

Installation

Clone this repo to your plugins or mu-plugins folder. When you load it in your mu-plugins folder, you have to call the plugin via a file that is directly in the mu-plugins folder. See this article for more information.

License

GNU GENERAL PUBLIC LICENSE

wordpress-ajax-filter-posts's People

Contributors

ians88 avatar lud avatar robbertdk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.