
Picker is a simple and flexible plugin which allow users to choose a specific post inside admin widgets page and display it in their site frontend.
If you need to display a specific post, not a generic list of last posts, top ranked posts, category posts, etc.. but only the one that you configure in the backend. Picker plugin makes it possible in a very quick and easy way. It adds a widget on the admin widgets page that you can use to select and show a post on your site’s frontend. You can work with standard types (like posts) and custom types simply by changing the settings page of the plugin.
Picker plugin is extensible in many of its features, such as, applying filters and action, managing layout template, etc.. moreover, plugin is based on the WordPress Transient API for caching issue.
As mentioned before, the plugin provides a way to override the default layout template. With a few lines of code, you can create your layout template (copying the default one) and completely override the plugin look&feel thanks to a complete access to all widget item data throw Picker classes.
You can use Picker plugin like all the other WordPress plugins, dragging the widget to a sidebar you can enable a Picker widget. Initially, the widget is not published on the frontend. In this way you can safely configure widget’s data and then publish/display the widget.
Picker widget is composed by the following fields:
For some field there is a jQuery validation to check right formats. Picker plugin checks all numbers, url and datetime fields showing you an alert if data are wrong.
Picker plugin provide a default widget template that show a linked title (using post title), the featured image of the post and the post excerpt. Alternatively, you can manage widget template overriding default template. Picker plugin has a tool to detect the template path used for widget layout inclusion.
This is the load order of the template files:
Picker plugin provides many filters to extend default behavior of the plugin core functions. This is a list of the most important available filters:
To better understand how you can interact with plugin filters, here are some examples.
If you want, you can modify the default (usually “picker/” folder), with a folder in your theme root. In the following example, adding the function to your “functions.php” theme file, we are telling to Picker plugin to search template files inside a “templates/” folder in your theme root.
function modify_picker_template_path() { return 'templates'; } add_filter( 'picker_template_path', 'modify_picker_template_path' ); Also, you can modify the default post title (usually “post_title” field), adding for example a prefix/suffix. In the following example, adding the function to your “functions.php” theme file, we are telling to Picker plugin to call your function before return to template the item post title value.
function modify_picker_post_title( $value ) { return 'my_prefix ' . $value; } add_filter( 'picker_item_title', 'modify_picker_post_title' ); As described in the previous paragraph, you can customize widget template according to you site specs. Inside the template file you can use a $picker_item global variable to access the picker class methods:
In addition to $picker_item global variable, you can use custom variables values, such as:
In the template file are available special variables, for now:
Very important is the widget_sidebar variable. With this value you can display a different widget layout according to which sidebar contains the widget.
To increase performance and reduce database queries Picker plugin use a persistent caching management. To get a persistent cache without using external plugins Picker plugin uses WordPress Transient API.
Anytime WordPress display Picker plugin on a site frontend page a calls Picker plugin widget management. First of all, Picker plugin look for a cached object into Transient cache, if found it, gets data, prepares HTML and provides it to frontend.
If data isn’t in Transient cache, Picker plugin go on with widget date and status validation, then, after looked up post into database, create Picker item object that contains all the widget post data, and in the end like a cached object prepares HTML and provides it to frontend.
Before concluding by Picker plugin widget management, the Picker item is saved to Transient cache. Only the Picker item is saved to cache, no HTML neither frontend logic are saved to cache. The goal to Picker caching management is only to reduce database usage.
Picker plugin cache has many expiration rules, the most important are:
Links: Author’s Site
Starting from $0 per month.
Rating
Reviewers
2 reviews
Tags
Developed By
Andrea Landonio
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Contact Form plugins for Wordpress
Forms plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Comments plugins for Wordpress
Portfolio plugins for Wordpress
Maps plugins for Wordpress
Security plugins for Wordpress
Translation plugins for Wordpress
Ads plugins for Wordpress
Video Player plugins for Wordpress
Music Player plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Chat plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Tabs plugins for Wordpress
Membership plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Inventory plugins for Wordpress
Video Player plugins for Wordpress
Testimonials plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Social Feeds plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Events Calendar plugins for Wordpress
Contact plugins for Wordpress
Comments plugins for Wordpress
Analytics plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Add social share buttons so visitors share content to major networks, boost engagement, and drive more referral traffic.
Collect candidate information with a job application form that organizes submissions, streamlines hiring, and helps you manage applicants efficiently.
Use a payment button for secure PayPal or Stripe checkout to simplify online payments and help increase sales.
Add an AI chatbot that answers user questions by crawling your site, using uploaded content, and collecting chat interactions.
Add a comments system with replies, voting, and moderation to boost engagement and build an active community on your site.
Add an interactive scratch card to engage users, reveal offers, and support lead capture through gamified participation.
Add a podcast player to your site to embed and organize episodes, provide responsive playback, and keep listeners engaged.
Add WhatsApp Chat to your site to communicate with visitors, deliver instant support, and create a smoother, more trustworthy user experience.
Create interactive polls with a poll widget that gathers real-time feedback, boosts engagement, and helps you understand visitor opinions quickly and clearly.
Create an online restaurant menu that organizes dishes, highlights key items, and helps visitors explore options with confidence.
Add charts and graphs to your site to present data clearly, help visitors understand insights faster, and support more confident decision making.
Create headlines with background images that blend text and visuals and let you control animation, position, and fonts.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
