I have a theme that is subtheme to both Corolla and AT Core.
What I want to do is add pagers to the top of the comments section rather than just at the bottom. (I'm not using Advanced Forum)

I found a snippet for this. https://www.drupal.org/node/141381#comment-4984614
But after putting the code in template.php (in my subtheme folder) and adding a print to the comment wrapper template (also in my subtheme folder), nothing happens.

My theme is definitely using the comment wrapper template (other fine tuning there). But no pager...

So my question is, am I missing something special in the adaptive/corolla/subtheme arrangement that would prevent

function mytemplate_preprocess_comment_wrapper(&$vars) {
	$vars['top_pager'] = theme('pager');
}

from working?

Comments

aharown07 created an issue. See original summary.

Jeff Burnz’s picture

Component: Design » Code

Did you clear the cache?

aharown07’s picture

Yes, thanks. Ran drush cc all.

Jeff Burnz’s picture

In mytemplate_preprocess_comment_wrapper() "mytemplate" is your themes name. I really wish people posting snippets would use the correct terms here, the hook is HOOK_preprocess_comment_wrapper(), where you replace HOOK wiht your theme or module name.

aharown07’s picture

Looks to me like I have that right.
My theme is named SICorolla so my function is written like this

function sicorolla_preprocess_comment_wrapper(&$vars) {
	$vars['top_pager'] = theme('pager');
}

I've worked a little with theme functions, and have a few that are working in this theme. But so far I can't get this snippet to do anything.

Maybe the function is working and there's something wrong with how I'm printing it in the wrapper template. Tried various versions of this...

<?php if (isset($top_pager)): ?>
  <nav>
    <?php print $top_pager; ?>
  </nav>
  <?php endif; ?>

If this all looks right, it's probably something wrong my execution... come to think of it, though I flush cache like crazy from the server command line, I'm not sure I sure I flushed the browser cache, and I've seen that behave in unexpected ways in the past (I'm using Opera lately and it seems to have different refresh rules than I'm used to)

Jeff Burnz’s picture

That is correct, the code is not wrong, check you have enough comments to trigger the pager to appear.