Note that there are some explanatory texts on larger screens.

plurals
  1. PODifferent <li> class based off of category or tag in Wordpress
    primarykey
    data
    text
    <p>My goal is to have action icons in lists that correspond to how the list item is tagged or categorized.</p> <p>For example, if I have a list item that is a webinar it should have a webinar icon next to it, the next item in the list might be a white paper, which should have a white paper icon next to it. The population of the icons should be controlled by how the list item is tagged or categorized.</p> <p>I don't know where to start; any suggestions are appreciated. Thanks!</p> <p><strong>EDIT:</strong></p> <p>Thought it might be helpful if I show the list I'm wanting to modify - technically, the items that I want to modify are in the <strong>span class=meta"</strong> section, but I'm open to using whatever method worls:</p> <pre><code> &lt;ul class="sub_nav"&gt; &lt;li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active last"&gt; &lt;a href="#resource_center" title="Resources II"&gt; Featured Resources &lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;div id="resource_center"&gt; &lt;?php $resources = get_posts("post_type=resource&amp;posts_per_page=2&amp;cat=31&amp;tag=featured"); ?&gt; &lt;?php foreach ($resources as $key =&gt; $resource): setup_postdata($resource); ?&gt; &lt;?php if ($key === 0): ?&gt; &lt;?php endif ?&gt; &lt;p&gt;&lt;span class="meta"&gt;&lt;?php echo apply_filters('get_the_date',mysql2date('m.d.Y', $resource-&gt;post_date), 'm.d.Y') ?&gt;&lt;/span&gt; &lt;a href="&lt;?php echo get_permalink($resource-&gt;ID) ?&gt;"&gt;&lt;?php echo $resource-&gt;post_title ?&gt;&lt;/a&gt; &amp;ndash; &lt;?php echo strip_tags(get_the_excerpt()) ?&gt;&lt;/p&gt; &lt;?php endforeach; ?&gt; &lt;span class="more"&gt;&lt;a href="/resources/"&gt;Read More&lt;/a&gt;&lt;/span&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload