0

I'm new here and brand new to Wordpress in general.

I have a page with different types of recipes - easy, medium, difficult. I am using a "Custom Post Type" to format it, which is fine, and I am using a "tag" to add the relevant difficulty level. I have a three-column archive page which shows a snippet of the article + the difficulty level below it.

Now, where I'm stuck is:

I would like to dynamically display an image instead of the label text. I don't have the image yet, but something like three chef's hats in a row. It's a very specific design, so I can't just use an icon set.

I know this should be possible with php, but my php knowledge is non-existent. I can use a plugin to add "Custom Functions", I just need to know what to add.

So, in short, what I'm looking for is:

  • ability to associate an image with each label
  • ability to display the image instead of the label, with alt-text for screen readers etc.

This is what Chrome's inspector is showing for the relevant area.

this is what the structure is currently when viewing with chrome's inspector

The "footer" is being added by the following custom script (given to me by someone). custom function to add the footer area

Thanks for any help!

0

You could do this pretty easily a couple of different ways. My preference would be with jQuery, but others could make an argument against that route and for php. Here is the way you could get it done with jQuery:

$(document).ready(function(){
    $( ".entry-tags a:contains('easy')" ).html( "<img src='https://image.url'>");
});
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.