To run the grid you must have at minium: PHP version 5.3.0
In the grid panel, we also added in the system requirement box some recommendations about your php limits.
These are just some recommendations and are not necessary to run The Grid properly.
At first, you need to download The Grid plugin from Codecanyon using your account.
At the root folder of this zip file, you will find an other zip file named the-grid.zip. This zip file will be used to upload the plugin.
To add a WordPress Plugin using the built-in plugin installer:
For information on how to install a WordPress Plugin manually, see this manual installation guide below.
In order to unlock the Skin Builder feature and to enable automatic update functionality, you must register The Grid.
The registration system uses a secure method from Envato in order to retrieve your purchase code from your user profil.
In the registration of the field you must enter a Personal Token generated by Envato (not a purchase code).
To generate a Personal Token from Envato, you need to follow these steps:
N.B: You must valide the personal token on Envato before to try to register The Grid otherwise it will not work
N.B: Because the registration system makes some requests on Envato server, if there is an issue from Envato then you will not be able to register The Grid. In this case you need to wait several minutes or hours before to try again.
The Grid comes with an automatic update functionality.
To update The Grid and check for new available version you must enter your Personal Token which can be generated with the Envato API.
To get your Personal Token, you must generate one here.
If you encountered some issues to generate the Personal Token or to register The Grid, you can still update manually with the following steps:
N.B: When a plugin or a theme is removed/updated from Wordpress, all files are physically deleted from your server.
So, if you have made change to the plugin/theme files, all these change will be lost
However, all data/options/posts are stored on your server database (MySQL). So, you will not loose any data when updating or removing a theme or a plugin.
In this section we will explain how to build your first grid with The Grid Wordpress plugin.
At first, go in The Grid admin panel through the left dashboard menu area.
You will find 3 sub-menus available:
To get started, click on the sub-menu The Grid > The Grid. If there isn't any grid then you will have 2 options: create a new grid or import the demo data.
Import the demo data will create the 20 grid examples which you can find on The Grid live demo
At first, click on create a new grid.
You will be redirected on the grid generator page.
Here are the main steps you should follow to create a new grid:
N.B. : All these steps are optional and a grid will be automatically generated with the default post type of Wordpress without any settings.
So, if you want, you can directly preview the grid and save it.
At first, under the General tab, you will find a field where you can enter your grid name
This field must be not empty and it should not contain a grid name which already existing.
While entering your grid name inside this field, you will see that it will also generated the shortcode on the field below.
You can copy/paste this shortcode everywhere you want in order to display the current grid (in an page/post text editor for example).
Under the tab Source, you can set the number of items to display inside the grid.
For example, if you set number to 6, then it will display 6 elements inside the grid (at first load).
you can select the post type(s) you want to display inside the grid.
Several post types can be selected as a source content.
N.B. : You will find more details under Source/Content Tab documentation
Under the tab Media, you can select the post formats you want to allow inside the grid.
For example, if you select video and audio formats, then the grid will retrieve any video/audio media content available in your post type source.
If video or audio are found, then it will be display inside the grid.
N.B. : You will find more details under Media Tab documentation
Under the tab Grid you can choose the style of grid:
You can also set the number of columns in the grid for different device sizes (browser widths):
N.B. : You will find more details under Main Grid settings Tab documentation
Under the tab Skins you can choose the skin of the items display inside the grid.
Just click on the skin you want for this grid to select it.
Depending of the grid style which was set under Grid tab section, available skins will be different for Masonry and Grid style.
N.B. : You will find more details under Skin settings Tab documentation
Now, you have configured the main settings of the grid, you can save it:
To insert a grid in a page or a post, you just need to copy paste the shortcode where you want to make it appear.
In the source tab you can deeply customize the type of content that you want to display inside a grid.
We have added all options which Wordpress offers to query the content from post types. There isn't any limitation and the possibilities are infinite.
You will be able to filter you content by any category(ies), status, author(s), meta key(s), etc...
N.B : By default the grid will display all the posts ordered by date in descending order (...,4,3,2,1,0).
Item Number correspond to the number of elements initially loaded in the grid:
Post type correspond to the main content you want to load in the grid like your post(blog), portfolio, product,...
You can add multiple post types per grid (unlimited number).
Post status correspond to the current post status you want to make appear in the grid.
By default publish statut is enable. But if you want, for example, to only display your futur blog posts (which you are currently writing) you can select "pending" or "draft" status.
Category Filter - In this section you can select several categories in order to filter the grid by the selected categories.
When one or more categories are selected then the grid with only display these categories from the current post type(s).
If no category is selected, then the grid will display all available categories from the current post type(s).
Exclude items - If you need to exclude some posts you have the possibility to add the ID of these posts in the field Exclude items.
In this text field you should enter the ID(s) of the post(s) to exclude from the source. Each ID must be separated by a comma.
You can also use the preview mode to exclude items and auto fill this field by click on the eye icon.
Ordering - Now that you setup the content of the grid, you can arrange it by different types of parameters.
You can order by date, title, post ID, number of comments, authors, meta key(s),...
All the possibilities offered by Wordpress are available.
Ordering Example : Display the most like post using the built in post like system from the Grid Plugin.
By ordering with a numeric meta value, you will be able to display the most like post by descending order for example. The meta key name is "_post_like_count".
The image below illustrate this example. It can be expanded to any meta key.
Meta Key Filter - If you want to deeply customize the content/source filter, you can use the drag and drop Meta Key filter interface.
With meta key, you will be able to filter your content by certain value such as, number of like, product price, product in sale,...
Meta data are generally used by 3rd party plugins in order to add some additionnal content to a post type (woocommerce price for example).
So, if you want to use a meta key to filter the content, you must ask to the plugin/theme author what is the meta key name which store the value you are searching for.
Meta Key Filter Example 1 : Display only posts which have more than 5 likes (using our built-in post like system).
The image below illustrate this example. It can be expanded to any meta key.
Meta Key Filter Example 2 : Display only products on sale.
Meta Key Filter Example 3 : Display only products on sale with a price superior to 40$ and with available stock. And orderby sale price in ascending order (from lowest to highest sale price).
The Grid Plugin support native Wordpress post format.
Here are the following supported post formats:
N.B. : Available Post Format will depend of the theme you are using. Some themes do not allow all post format.
These format are supported in all skins (except for Quote & Link format which are only supported in masonry layout).
If you have correctly set the post format in your post and also added directly in the content a gallery, a video or a song then The Grid plugin will be able to retrieve these contents.
Alternatively, you can use our own post format settings to add extra content for image, gallery, video, audio, quote and link.
You will find in each post type a setting box where you can add your content according to the selected format.
The alternative content setup in this option box will be retrieve at first and if no content was found then it will search the first media content in the post content.
These settings are also available when you preview the grid in the admin panel. You can easly access to all posts settings in preview mode.
Youtube/Vimeo Video - To add a Youtube/Vimeo embed video you must enter the video ID into the corresponding field.
You will find YouTube or Vimeo's video ID, by visiting the video on Youtube.com or Vimeo.com. The ID is located in the adress bar like this:
You can also set the aspect ratio of the video in order to perfectly fit to the video you want to embed.
Audio Format - To add an embed Soundcloud song you must also enter the ID of the Soundcloud song.
To get the SoundCloud ID you must click at first on share button. Then you must click on embed and copy the number you will find just after "//api.soundcloud.com/tracks/" in the url.
You just need to paste this ID in the SoundCloud field.
In the grid settings under media tab, you have the possibility to allow or not post format like video, audio, quote, link...
In this settings tab, you also have the possibility to show all post format video in a lightbox instead of displaying the video inside grid element.
Just by activating this option all videos will be automatically played in a lightbox.
N.B. : All skins are compatible with video/audio media and can be play directly in a grid item (by default; in a lightbox optionnal).
Image Format - Depending of your grid settings (number of columns), it might be interesting to load images which have the right sizes in order to improve the loading speed.
You have 2 possibilities to optimize image sizes:
Image sizes are generated when you upload new images in Wordpress. So, if you want to use one of the image size set in Global options with images uploaded before installing The Grid then you must regenerate them. You can use a plugin like Regenerate Thumbnail to regenerate all image sizes.
N.B. : Smart resize option currently doesn't work with CDN.
Social Media Content
Since v1.3.1, The Grid allows to display external content:
In order to display social media content in the grid, you need at first to enter your personnal API key for each API in the Global settings under API tab.
For each API, you must generate your personnal key and enter it in this global setting panel.
Under each field, you will find a link in order to generate this key. Please follow the instruction provided by the social company in order to generate your API key.
In order to preserve performances, The Grid will cache the result from any social media content during one hour.
This will allow to improve drastically the loading speed of your website by preventing to fetch data from an external server each time.
After setting up your API keys, you will be able to use social media content.
1. Instagram
You can display in the grid posts from your Instagram account.
Facebook requires users to create a Facebook app with Instagram Basic Display API to get a long-live Instagram Access Token.
Follow our instructions on this section to get your own Instagram Access Token and paste it back in your grid settings.
You will need:
1. Add a facebook App
Go to developers.facebook.com and login with your Facebook account. Then click on My Apps then on Add a new app
On Create an App ID popup, select For everything else option:
Enter your app name, then click on Create App ID button
Complete the Google reCAPTCHA check. Click on Submit button.
Navigate to Settings >> Basic page. Enter the Privacy Policy URL and Terms of Service URL of your website. Select the Category and Business Use for your app.
Click on Save changes button.
Still on Settings >> Basic page, scroll to the bottom of the page and click Add Platform.
Choose Website, add your website’s URL, and save your changes.
2. Configure Instagram Basic Display
Click Products, locate the Instagram Basic Display product, and click Set Up to add it to your app.
On Basic Display page, scroll to the bottom of the page, then click Create New App.
In the form that appears, complete each section using the guidelines below.
Display Name
Enter the name of the Facebook app you just created. Click Create App button.
Valid OAuth Redirect URIs
Enter your website’s URL.
After you enter a URL, save your changes and check the URL again; Instagram may have appended a trailing forward slash depending on your URL structure.
Deauthorize Callback URL
Enter your website’s URL again.
Data Deletion Request Callback URL
Enter your website’s URL once again.
Save your changes before heading to the next step.
3. Add an Instagram Test User
Navigate to Roles > Roles and scroll down to the Instagram Testers section. Click Add Instagram Testers and enter your Instagram account’s username and send the invitation.
Open a new web browser and go to www.instagram.com and sign in to your Instagram account that you just invited.
Navigate to (Profile Icon) > Click on the cogwheel icon next to Edit Profile button > Apps and Websites > Tester Invites and accept the invitation.
Your Instagram account is now eligible to be accessed by your Facebook app while it is in Development Mode.
4. Generate Access Token for Test User
Navigate to App Dashboard >> Products >> Instagram Basic Display >> Basic Display page and scroll down to User Token Generator section. Click on Generate Token button.
Log in with your Instagram account. Allow the app to access your Instagram account data.
Click on I understand checkbox then copy your Instagram Access Token.
Paste your Instagram Access Token in your grid settings
2. Youtube
You can display from Youtube:
One channel and one playlist can be displayed per grid in order to preserve performance.
For Youtube video(s) source you can enter multiple video IDs separated by a comma.
IDs can be found in the Youtube url.
3. Vimeo
You can display from Vimeo:
One user or ID can be set per grid in order to preserve performance.
User an IDs can be found in the Vimeo url.
4. Facebook
You can display from Facebook:
Public group page and Public album require a valid ID in order to fetch the content from Facebook.
You will find Facebook ID in the url of the group or album page or you can use some web services to get the ID.
5. Twitter
You can display from Twitter:
6. Flickr
You can display from Flickr:
7. RSS Feed
You can display from a RSS Feed any valid rss feed url.
A lot of services have RSS feed like:
Main grid settings
The grid plugin offer 3 main types/layouts to display your content:
You can adjust the space between each item in the grid thanks to the gutters options.
If you are in Grid style, then you will have the possibility to adjust the item ratio. It corresponds to the ratio between the width and height of the item in the grid (like 4:3, 16:9 format).
Each item in the grid can have different sizes (number of row & column). The size of an item can be set in each edit post page or directly in the preview grid mode.
There is also an option to override all item sizes individually set for any post types.
In that way you can force each element in the grid to have the same size even if a size was set individually for an item.
Column settings - The Columns section will allow you to assign a number of column for different screen widths.
You can also set up the associated browser width for each number of column by activating "advanced column settings".
In preview mode, you have the possibility to switch from the different browser widths and to check what will look like the grid for different widths.
Filter/sorter settings
One of a great feature of The Grid Plugin is the ability to filter/sort the grid.
You have the possibility to use any custom taxonomy like category, tag, format to build one or several filter areas for your grids.
The available taxonomy terms (filters) will depend of the selected post type.
To build you filter areas, you simply need to drag and drop the desired terms in the filter area.
If you want to add several filter area you can create unlimited number of areas thanks to the button "add filter".
You have some options inside each filter area to arrange/order terms, to display the number of filter and choose the text displayed for this filter (all button, dorpdown sentence,...).
The filter areas you created are available under the grid layout tab. You can drag & drop these filter areas everywhere you want in the available layout area.
Because you have the possibility to generate several filter areas, you have an option to create combination filter.
By combination, we mean that you can activate different filters at the same times to filter the grid.
There are two different combinations possible:
N.B. : On the front end, if element inside the grid doesn't have any terms corresponding to the filter areas, then these area will not appear.
The terms inside filter areas are also update in real time when appending new items. So if you append new element in the grid the number of filter will be updated and new filters can also appear if there wasn't present before.
Sorting - In this section you can customize the drop down sorter.
You can select several items you want to sort with and also choose the text to display in the drop down filter.
You also have the possibility to filter the grid onload by a selected value/term and to choose the order (ASC/DESC)
Add custom filter : You can add custom sorters from any custom meta data.
In the Global settings admin panel, you have the possibility to add unlimited number of custom meta data keys un the tad Meta Data. Once you added some custom meta dat key, this meta data will be available in the filter dropdown list.
N.B. : The dropdown soter list will also be available in Layout tab
Pagination settings
The Grid comes with a powerfull pagination system. It will allows you to recreate a complete portfolio page with a real pagination system.
You also have the possibility to add an ajax pagination to load the next page without refreshing the browser.
You can deeply customize the pagination system (not in ajax mode since it's like a load more button) in order to adjust the number of button pages to display, the prev/next buttons, the page lenght, etc...
Layout settings
In this tab section you can compose your grid layout by dragging and dropping available elements.
Available elements will depend of the grid layout and of the filter areas.
The grid layout have 6 differents area where you can place elements.
In each of these areas you will find settings to horizontally align elements inside area and to add some margin/padding and a background-color.
Left and Right areas are only available in Horizontal (slider) mode.
Grid Layout - The Grid offer 2 kinds of layout:
In vertical layout, you have the possibility to force the grid to fill the entire width of the browser.
With horizontal layout, you have an additional option to force the grid to fill the full height of the browser window. In that way, with horizontal mode, you can have a grid slider which fill the entire browser screen responsively.
When you activate the horizontal layout, new options will appear at the bottom of this section to setup the slider.
In horizontal layout (slider) if you are in grid style mode then you will have the possibility to set the number of rows to display inside the slider.
In Masonry style, you can only have a 1 row slider because each element can have a different height (so, a row doesn't have a known height).
The slider comes with 4 item navigations:
You have the possibility to start the slider to a certain position with the option "Slider Start at".
You can also auto play the slider and setup the autoplay speed.
Skin settings
N.B: You will find in the main downloadable .zip package on CodeCanyon (under download section), several custom skins which replicate all native skins provide with The Grid
Item Skin
In this tab section you can set appearance of elements inside the grid for each post types.
You will find a dropdownlist to select the post type for which you want to select a skin.
Depending if you are on Masonry or Grid layout, available skins will be different.
Masonry Skins:
Grid Skins:
Just click on the desired skin to select it.
You also have the possibility to add a skin per item in the grid. In each edit page of a post type you will find a box where you can select a skin for the current post.
These settings are also available in the preview mode by clicking on the setting icon. When a skin is selected for a post then it will override the default skin set in the Grid Admin panel.
Skin colors - You will find two color palettes to add custom colors to the skins.
Content Background color corresponds to the background color where the excerpt of the post is displayed.
Opposed as the overlay background color which corresponds to the background over an image.
For each of these background colors you can set an associated color scheme. This color scheme can be this in Global Options
Navigation Skin
The Grid comes with 7 navigation styles. Navigation correspond to the buttons, dropdown lists, slider arrows,...
You can customized colors of the navigations elements thanks to the colors palettes. You have the possibility to set this color for inactive and active state.
Navigation background color is only available for background styles.
Animations settings
The grid offer more than 40 animation styles to animate items while filtering, sorting, searching, revealing, etc...
Just select an animation from the dropdown list and adjust the animation speed in ms thanks to the range slider.
Load/Ajax settings
Load More items with ajax (button and scroll methods)
With The Grid, you can add a load more button in order to load more items in the grid with ajax.
You can set the number of items to load by clicking on the load more button and also adjust the delay between each new item appended in the grid.
If you want to use the load more button, you must add it in one of the available area in the Layout tab.
In the load more button you also have the possibility to show the number of items that remain.
When On scroll option is activated, new items will be loaded when the end of the grid container will be reach on scroll.
If you put the load more button, it will be used to indicate that new items are currently loaded. Otherwise, a message will be shown at the bottom of the grid.
Preload items in the grid (images)
The Grid needs to wait that all images are correctly loaded before executing the rest of the script in order to correctly calculated item sizes (in masonry mode).
Because there is a delay between images finished loading, the grid will not looks like good during this delay.
In order to make the loading time more attractive, you can add a preloader animation until the images are loaded.
The Grid comes with more than 13 preloader css3 animations
At first you need to activate the preload option in order to get acces to the list of all preloaders.
Just select a preloader and directly get a live preview of it. You can adjust the size of the preloader animation and its color.
As for ajax loading, you can add a delay between each item when they appear in the grid.
If no delay is setup in Preloader item delay then all items will appear at the same time.
Custom CSS/JS code
If you have some knowledge in css or jquery then you can add some custom scripts in this section.
When adding custom css code, we highly recommend to target the element to customize with the css grid name that you can set in the general tab.
This will prevent to apply the same style to all grid in the same page.
Examples :
Date/Category/terms colors:
Quote/link title color on mouse hover:
Quote/link background color on mouse hover:
Quote/link heart liked color:
Mediaelement Video/Audio player controls colors:
Term/Category color
The Grid also include some options in every terms (like category, tag, format, ...) to add color.
This color can be used in a skin to highlight term/category as you can see in the above screenshot.
Global Settings
In this admin panel you will find general options about The Grid plugin:
Color schemes :
Previously, in the section Skin Settings we have talk about how to apply a color scheme to a skin. These text colors can be setup in this admin panel.
There are 2 color scheme: dark and light. For each color scheme you can set the color title, the paragraph color and the sub-element color like span tag (category, date,...).
Image sizes :
You have the possibility to add and customize 5 additional image sizes that we added in the Grid Plugin.
These image sizes can be used in the media tab when creating/editing a skin.
N.B. : If you have uploaded images before installing the grid plugin and you want to use this image sizes then you must regenerate your images with a plugin like Regenerate Thumbnails Plugin.
LightBox :
The Grid include it's own ligthbox plugin. This lightbox is compatible with image and hosted/embed(youtube,vimeo) video.
You can customize the lightbox color from the Grid.
If you are currently using another lightbox plugin and that you want to keep using it, The Grid is also compatible with these two lightbox plugins:
Medialement :
Mediaelement is an html audio/video jquery plugin natively included in Wordpress. It allows to play hosted audio and video media in a customizable interface.
The grid is compatible with Mediaelement. Because mediaelement is a native functionality of Wordpress, most of developers include it in themes.
So by using mediaelement, you maybe already have a stylesheet included in your theme that apply style to the mediaelement player.
This styles can create conflict with the grid plugin. Our plugin will try to remove this style sheet (when you activate Add Mediaelement Grid StyleSheet) but if the styles are included in the main style sheet of a theme then conflicts can appear.
We cannot be reponsible of these type of issues because it's an unevitable conflict. In that case you should contact the theme author to ask how and where he add styles for mediaelement.
Smart resize :
By using smart resize, you will reduce the number of calculation during resizing the browser.
This allows you to improve performance while resizing browser.
This feature can create an horizontal scrollbar during resizing depending of the theme layout. If you encounter any problem, please deactivate this option.
Caching System :
We created a caching system in order to increase performances and reduce the loading time.
When the cache is enable, the grid will become static and if new post is added then it will not appears in the grid.
You need to clear the cache every time you change something to a post (change image, title, content,...) or create/remove a post.
When a grid is save, then the cache for this grid is clear. You can manually clear the cache in the global settings panel.
N.B. : If you are already using a cache plugin, then you don't need to activate this cache option. If you frequently update/add posts then you should not use this option.
Debug Mode :
The Grid use minify file on front end in order to reduce file sizes. So, if there is some issue in the script, it will be hard for us to debug.
That's the reason we created a debug mode in order to easly identify an issue on your website and to fix it.
You should not use this option for performance reason. Only activate this option when you need to debug the plugin.
Import/Export
The Grid comes with built-in export/import functionnalities. In that way, you can easly save your grid and re-import them.
To Export a grid, you just need to select one or several grids in the dropdown list. It will generated a .son file with all grid settings.
One file can handle multiple grids.
To import a grid, you need to upload the .json file created with this importer.
You find in the import section 2 buttons, one to import a .json file and an other to import demo data.
When importing the demo data, 20 grid examples will be generated. These grid examples can be find on The Grid live demo.
Use The Grid as a template
You can now with The Grid replace any template which use a main Wordpress query.
It means that you can easily replace your index blog page, search & archive template or shop archive page from Woocommerce.
The grid will automatically fetched the right content from these templates and displayed items in the grid.
To replace the index/search/archive templates of your Theme, you need to edit the index/search/archive.php file located at the root folder of your theme:
In these files, you will find the main loop:
You just need to replace all the previous php code by this line of code:
In the grid settings under skin tab, you need to setup the skin used for each post type.
The number of item on load present in the grid can be set as usual in Wordpress > Settings > Reading panel.
You can't control this number the grid settings because it's part of the main query of the current template you are trying to replace (this is how Wordpress works).
However, you can control the number of items to load more with ajax method if you are using an ajax pagination or a load more button.
You can do the same thing for Woocommerce archive-product.php template. You need at first to replace this archive template by adding it in your theme (or child theme):
theme-folder/woocommerce/archive-product.php
Then you just need to replace in this file the main loop as explained previously. That's all!
N.B.: For any modification, you should use a child theme.
If you don't have a child theme then you should ask to the theme author.
Troubleshooting
If a grid that you added on a page doesn't display, please check these possible source of issues:
If you observed some issues with the grid appearance it can be due to a conflict with the theme you are using or with a 3rd party plugin. Some themes add styles and force them for every elements in a page. It can affect the appearance of a grid and generate layout issue. Do not hesitate to open a ticket on our support forum. We will look at your issue.
For any issue do not hesitate to contact us on our SUPPORT FORUM.
Developer Guide
The Grid Plugin is developer friendly. We have included several filters to easly integrate the grid in your theme or to create a 3rd party plugin based on The Grid Plugin.
In this section we will explain to you how to:
Add an item skin
There are 2 ways to add a new item skin. You can use our filter and specify the directory where you added the .php and .css files to build the skin or you can directly add a new directory in your theme (not work with a plugin).
Add directly new skins in a predefined theme directory
If you want to add new skin directly in your theme you just need to create a new folder at the root folder of your theme. This directory must be called "the-grid".
My-themeIn this folder you must add your skin(s) in a subfolder call "masonry" or "grid". The sub-folder will depend name if you want to add a masonry or a grid skin. Then create a new folder name with the slug name an put your .css and .pph file inside it.
the-grid
masonry
my-skin1
my-skin1.css
my-skin1.php
grid
my-skin2
my-skin2.css
my-skin2.php
Now you have included these files inside your theme, you need to register your skins.
You can register your skin(s) by adding this code in your main function.php file of theme (or child theme):
N.B. : With this filter you will also be able to unregister native skins from the grid by removing them from the array.
OR add your skin files in a custom directory
You can also use the below filter to declare your skins files. So you can place the skin files everywhere you want.
Create a new skin
In the section above we have explained how to register your skins and now we will explain to you how to create a skin.
A skin consist of 2 files:
We have created an API in order to easily retrieve for each item whatever the source type like the title, the excerpt, the date, the comments numbers, images, ...
This API will be very helpful to take full control of functionalities provided by The Grid Plugin.
Because each skin in The Grid plugin are compatible with video & audio content (with custom play button), we highly recommend to use this API.
To retrieve data from the API, you need at first to initialize the API class from our single class instance like this:
You will be able to get all necessary content from this instance.
You will find below the complete list of all functions which allow to output content related to item content.
All content output thanks to these functions are already escaped.
Some of these functions accepts an array of arguments in order to setup the output.
Click on info to see what it will return (it doesn't echo):
And here a full example to build a grid skin (Brasilia skin example) thanks to the above function :
Of course, you can do exactly the same things with your own markup and the std wordpress function.
However, you must add an alternative content for all data you retrieve in order to display it in the backend admin (for the skin preview).
We added a global variable which is set to true when the current skin is retrieved for the preview (slider) in the backend.
N.B.: When retrieving data in a skin, you are not in a Wordpress loop (from a query) but in a custom loop from The Grid API.
So you must use the item ID to use native function of Wordpress like get_the_title();
In that way, 'The Post Title' will be displayed in the grid skins preview in the backend instead of an empty string.
You don't need to use this method for custom metadata. The Grid will automatically display the metakey in skin preview mode.
Now you have built the markup, you just need to apply some styles to the skin.
You must use the skin slug (file name) in order to target your classes to prevent any conflicts with other skins:
N.B. : You will find all skins in the directory the-grid > includes > item-skins. You can start from one of this skin to build yours.
Add a navigation skin
Adding a navigation skin (for filter button, load more button, page, dropdown list, ...) consist of applying new css rules to existing markup.
We included a filter to register custom css for this elements. In this filter you will be able to get all colors options in the admin panel (in the grid builder) under skins tab.
Please look at the following example:
So it consist just of adding css in a php array.
N.B. : You will find all navigation skins in the directory the-grid > includes > navigation-skin.class.php.
Add an item animation
A simple filter to add new kind of animation. Works with any transform properties.
Add a preloader animation
The following example will show you how to add a new preloader animation (with your own image for example).
Change cache/transient expiration
The Grid Plugin comes with it's own cache system. You can modify the transient expiration (by default it's 7 days).
Change The Grid query (for post type only)
If you want to add additionnal parameters to the custom query created by The Grid, you can add the following filter in your main function.php file of your theme (or child theme):
Skin Builder
Introduction
The skin builder allows to create custom skins with ease thanks to an intuitive drag & drop interface.
To get start with this functionnality, we highly recommend to import skin demos at first (instead of creating a skin from scratch).
Create/Edit a skin
Once you have imported the skin demos or you have started by creating a new skin, you can edit your skin.
At first, you need to give an unique name to your skin. You can also assigned a category name to this skin in order to easily find it in the skin builder overview or in the grid settings admin panel.
Each skin is intended to work with an unique grid style: Masonry or Grid/Justified style. You can set this style in the item layout tab (in the layout settings panel):
Skin Layout
At first, you need to build the main layout of your skin. All the general layout options are available in the Layout Settings panel under item layout tab:
In this tab you can choose which content holders you want to display (depending of the skin style) in the skin: Top/Bottom content, Media content and overlay.
The overlay can be hidden, it can also take the full size of the media or have its size based on the content avaialble over the media.
Each of these container, can be styled in the Layout settings panel (exactly like for an element style).
Add Element
The skin builder comes with several predefined elements.
Once you have added a new element in the skin, you can click on it in order to edit its content, appearance, action, animation.
Save Element
You can save your own elements in order to use them later in any other skin.
To save an element, you need to click on it and after click on the bottom green icon (save as template).
Each custom element have an unique name and can be overridden by entering an existing element name.
Your custom elements will be added in the Add Element panel under customs elements tab.
Edit Element
To edit an element, you need to click on it (If you drag an element and then release, it will not select the element).
Once you have clicked on an element in the skin, a new popup will be opened.
TIP: Sometimes, depending of the skin and elements positions, it can be a little bit difficult to select an element on click.
You can still select any skin element thanks to the dropdown list next to the green button "Add element".
In that way, even if you have elements one above each other, you will be able to select the desired element.
In this element settings panel, you will be able to set:
Element Styles
When an element is selected, you can adjust its appearance by clicking on the styles tab.
2 states are available to add styles: Idle State and Hover State (when the mouse is hover an element)
You will find near all properties available to style any element. If you want to go deeper and add some properties which are not available then you can also add your own css rules in custom tab.
If you want to have alternative styles on mouseover, then you must check apply styles on mouseover (under Hover State tab).
Each style property has an important option which allows to force this property. This option can be used in 2 main cases:
This important rule, will force a style property and override all other existing styles attached to any element of a theme or plugin
For example, if your theme applies an underline decoration for a link, then it will also apply this underline style for any link in a skin.
However, by selecting important rule, and setting the text decoration to none, you will be able to remove this underline:
Element Animation
Animation allows to show, hide or only animate an element on mouseover from a parent container (not directly on element mouseover - Styles -> Hover State).
The skin builder comes with 20+ preset animations. You can adjust each of these animations presets or create your own custom animation.
To see the result of an animation, you must be in preview mode.
You can directly edit the animation in preview mode by making a mouse over the skin in order to see the result instantly.
Element Alignment
There are 2 ways to align elements (left/center/right) in a skin:
By editing element styles
In the edit panel of an element, under position tab (in the styles tab), you can assign a float value (left/right) if the position is set to inline-block:
By applying an alignment on the parent container
You can also align all element present in a content holder, by modifying the styles of the content holder (Top Content/ Media Content Holders/ Bottom Content):
Important: If the element have an absolute position, then the alignment will be not applied.
Element MetaData
With the skin builder, you have the possibility to add custom content hanks to metadata.
There are 2 ways to add metadata content:
Post MetaData
With post metadata, you need to enter the metadata key name in order to display your metadata value:
Text/HTML
If you want to go deeper with metadata and use the value to add style or anything else you can use the Text/HTML source.
To fetch the metadata value, then you need to use this shortcode: #meta:my_meta_data_name#
In the previous example, we use the metadata value to add a width in % to a container.