Hi,
Yes I want to change the tag icon size. But I’d also like to remove the “alignleft” class added to thumbnail images.
So I thought I’d use your instructions directly to edit this.
So I followed the instructions of adding a new shortcode as per the post mentioned.
This is “MenuItemThumbnailShortcode.php” in my theme folder, inside another folder foodlist_ext
<?php
namespace foodlist_ext;
use Artprima\Text\Shortcode;
use Artprima\Text\ShortcodeManager;
use Foodlist\Project\WordPress\Plugin\Foodlist\Manager;
class MenuItemThumbnailShortcode extends Shortcode {
public function getTag()
{
return 'menu_item_thumbnail_casa';
}
public function apply($attrs, $content = null)
{
$cur = Manager::getInstance()->get('curitem');
$postData = $cur->getPostData();
$id = $postData['id'];
$result = '';
if (has_post_thumbnail($id)) {
$result = get_the_post_thumbnail($id, 'fl-menu-item-thumb', array('class' => 'fl-menu-item-thumb'));
}
return $result;
}
}
Adding to my functions.php
function my_register_thumbnail_shortcode(\Artprima\Text\ShortcodeManager $sm) {
$sm->registerShortcode(new \foodlist_ext\MenuItemThumbnailShortcode());
}
add_action('foodlist_register_menuitem_shortcode', 'my_register_thumbnail_shortcode');
Now it crashes the menu out, without including the new shortcode on the page.
Should the PHP be in a different folder? I’m fairly proficient in PHP, but the fact that following your instructions it crashes out seems strange.
Cheers