• Resolved tmakitalo

    (@tmakitalo)


    Hi,

    I´m using this plugin but I would like to add two small icons/images next to the title.

    But if I put a <img src> or a shortcode that will give me a image I get the following error:

    Please enter a title attribute: [accordion-item title=”Item title”]

    I would like to use icons to:

    1. let the visitor know what “category” or “section” the title belongs to.

    2. Some kind of + icon so that they konw that they can click it to read more.

    Any idea?

    https://wordpress.org/plugins/accordion-shortcodes/

Viewing 1 replies (of 1 total)
  • Plugin Author philbuchanan

    (@philbuchanan)

    You can easily add the same icon to every title using some simple CSS in your themes stylesheet.

    /* For closed accordion items */
    .accordion .accordion-title {
        background-image: url("closed.png");
        background-position: right center;
        background-repeat: no-repeat;
    }
    /* For open accordion items */
    .accordion .accordion-title.open {
        background-image: url("open.png");
    }

    This will give you two icons, one for closed items, and one for open. Be sure to replace the file path in url("...").

    Added a custom icon to each title will be more difficult as the plugin doesn’t easily support it right now. As a work around, you could use some more custom CSS and nth-child but that will be more difficult to update and won’t support older browsers.

Viewing 1 replies (of 1 total)
  • The topic ‘Images/icons or code in the titel?’ is closed to new replies.