theme classes ignored in pods page custom template

0

Hi, I'm using the roots theme on a site with pods. I've create a specifc pods wp template 'page-pods', removed the loop and added in pods-content(). So far so good. The 'main' class and 'sidebar' class are normally provide from the roots theme options:-

  <div id="main" class="<?php echo $roots_options['main_class']; ?>" role="main">

With my pods custom page set to the template, the classes are not being filled, my template is rendered as:-

<div id="main" class="" role="main">
    <div class="container">
        <h2>a pods template</h2>
    </div>
  </div>

The templates on the rest of the side pull the default main class correctly.

I'm guessing that pods is processing the template differenctly to WP and causing the roots variables not to be available.

Any thoughts? - I can code round this easily, but it would be nice to use standard classes throughout.

Thanks,

asked Jan 28 at 2:37

caroig

16

add comment
enter at least 15 characters

2 Answers

0

I'm in the process of using Roots to re-theme one of my sites. One thing I don't like about roots is how the author has used variables instead of functions to retrieve theme-specific data.

Make sure that

 global $roots_options; 

is the first line of your template code after your description block. I can't remember, but I'm not sure if I also had to add this line to the roots functions.php at line 19.

answered Jan 30 at 5:46

chris.pilko

884

add comment
enter at least 15 characters
0

That worked fine - thanks - I haven't need to change functions.php

answered Feb 5 at 5:19

caroig

16

add comment
enter at least 15 characters