• I wanted to add some vector icons to my list of simple links and I had to add these 2 lines of code in the plugin template.

    $item = do_shortcode($item);

    At the end I got the vector Icons from “WP SVG Icons” Plugin in a shortcode and it worked perfectly.

    in simple_link_list_widget.php

    Line: 47 – 61

    <?php foreach ($items as $num => $item) :
    	if (!empty($item)) :
    		if (empty($item_links[$num])) :
    			$item = do_shortcode($item);
    			echo("<li class='" . $item_classes[$num] . "'>" . do_shortcode($item) . "</li>");
    		else :
    			$item = do_shortcode($item);
    			if($item_targets[$num]) :
    				echo("<li class='" . $item_classes[$num] . "'><a href='" . $item_links[$num] . "' target='_blank'>" . $item . "</a></li>");
    			else :
    				echo("<li class='" . $item_classes[$num] . "'><a href='" . $item_links[$num] . "'>" . $item . "</a></li>");
    			endif;
    		endif;
    	endif;
    endforeach;
  • The topic ‘Add shortcodes for vector icons to the links’ is closed to new replies.