WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating my pages links in wordpress, using wp_list_pages(). each link contains an <i> tag which displays retina icons. I want to set a different class for each link in order to display a different retina icon. my code so far is this:

<?php wp_list_pages('link_before=<i class="A RETINA ICON CLASS NAME"></i>&link_after=<br >'); ?> 

How can I do that using pages meta data?or other ways?

share|improve this question

You can do it easily with jQuery by using .eq() to add a specific class to each i element.


Add a class to your i element from PHP.

<?php wp_list_pages('link_before=<i class="retina_icon"></i>&link_after=<br >'); ?> 

Then add another class to it with jQuery.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.