• Can’t find a proper plugin (recent) to add an icon beside article’s title from a certain category.

    I would be happy also to add the icon on the relative thumb instead

    Please help

Viewing 7 replies - 1 through 7 (of 7 total)
  • That could easily be done with some CSS Pseudo Elements:
    https://www.w3schools.com/css/css_pseudo_elements.asp

    ::before

    Thread Starter acqua

    (@acqua)

    Tks but I don’t know where to start

    I am sure you could find a local web designer/developer who can assist you. Or if you post a link to your site, someone here may be able to tell you how to add the CSS.

    Moderator bcworkz

    (@bcworkz)

    Use your browser’s element inspector developer tool to determine the proper CSS selectors for such title elements. Ideally, some evidence of the chosen category should be in a class somewhere in the article hierarchy. If there isn’t any such class, you may be able to inject one through a filter such as “body_class”. Your ability to do so is theme dependent.

    Once you’ve determined the correct selectors, add the ::before pseudo element directive after the selectors and add appropriate CSS rules as needed to place the icon where you want. All the CSS code so developed can go in the Additional CSS panel of the customizer.

    Thread Starter acqua

    (@acqua)

    My site:
    https://interfans.org/
    For instance how to add a michrophone icon to posts titles of the podcast category?

    Moderator bcworkz

    (@bcworkz)

    In Additional CSS:

    .category-1913 .entry-title.td-module-title::before {
        font-family: dashicons;
        content: "\f482";
    }

    This assumes you have the dashicons font, normally used in the backend, loaded on front end pages. You can do so with wp_enqueue_style( 'dashicons' ); called from a callback hooked to “wp_enqueue_scripts” if you want to use that specific \f482 icon. You may use any icon font or image file you like.

    Thread Starter acqua

    (@acqua)

    I was able to add it thanks.

    I would like it to show on the post’s page, for example:
    https://interfans.org/podcast-ep-67-tornati-sulla-terra/

    Or in any module in the homepage

    As of now it only shows on cat page:
    https://interfans.org/archivio/podcast/

    Can you help more?

    • This reply was modified 5 years, 5 months ago by acqua.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Category icon’ is closed to new replies.