Add to a Page/Post

Add your Essential Grids to your WordPress pages or posts.

Table of Contents

1. Shortcode Generator

From your page’s main editor, select the Essential Grid icon from the tool bar.

Then from the “Choose Predefined Grid” section toward the top, select your grid from the dropdown list.

Result:

2. PHP Method (advanced)

Important Note

This technique involves editing your theme’s page template files, which should only be attempted by experienced users. In the following example, we’ll add the grid’s shortcode to the TwentySixteen theme’s “page.php” file.

Step 1: Grab your grid’s shortcode from the plugin’s main admin page.

Step 2: Choose to use one of the code variations below.

Add Grid to ALL pages:

 <?php
 
    // Ess. Grid shortcode is placed inside the "do_shortcode" method, wrapped in single quotes
    echo do_shortcode('');
 
?>

Add Grid to Homepage only:

<?php
 
    // example to add the grid to the homepage only
    if(is_home()) {
 
        // Ess. Grid shortcode is placed inside the "do_shortcode" method, wrapped in single quotes
        echo do_shortcode('');
 
    }
 
?>

Add Grid to a list of certain pages only:

<?php     

    // id's of pages to add the grid to
    $page_ids = array(535, 716);

     if(in_array(get_the_ID(), $page_ids, true)) {
         // Ess. Grid shortcode is placed inside the "do_shortcode" method, wrapped in single quotes
        echo do_shortcode('');
     }
 ?> 

Step 3: Add the adjusted code variation to one of your theme’s page template files.

Add to a Page/Post

The Author

KC

Strength does not come from winning. Your struggles develop your strengths. When you go through hardships and decide not to surrender, that is strength.

Liked this Post?
Please Share it!

[tp_popular title="Popular Grids" regex="(grids|template_library)" count=3]

Newsletter

Join over 25.000 others on the Essential Grid and Slider Revolution email list to get access to the latest news and exclusive content.