I'm using Fishpig's wordpress integration for magento.
I need to set even and odd class for posts in category list. Category page is written by post/list.phtml - code is below.
For basic magento catalog/category in my custom theme I use this script which works nicely.
<script type="text/javascript">decorateList('products-list','none-recursive'</script>
This is post/list.phtml and decorateList nor decorateGeneric functions don't work because in front end I get <li class="item">
<?php $posts = $this->getPosts() ?>
<?php if (count($posts) > 0): ?>
<div class="post-list">
<ul id="post-list">
<?php foreach($posts as $post): ?>
<li class="item<?php if ($post->isSticky()): ?> featured is-sticky<?php endif; ?> <?php echo $post->getPostFormat() ?>">
<?php echo $this->getPostRenderer($post)->toHtml() ?>
</li>
<?php endforeach; ?>
</ul>
<script type="text/javascript">decorateList($('post-list'));</script>
<script type="text/javascript">decorateGeneric($$('ul.post-list li.item'), ['odd','even','first','last'])</script>
<?php echo $this->getPagerHtml() ?>
</div>
<?php endif; ?>
Does anyone know what could work for me?
Thank you in advance
<script>
tag first mentioned in your post accurate, as it's missing some characters that would cause it to error - if it is.