- This topic has 4 replies, 2 voices, and was last updated 1 year, 9 months ago by .
-
Topic
-
Anh – I found this code snippet and wondered if this could be modified to work with MB? Turns out that there is a third-party ACF addon that does the same thing…
add_shortcode('ss_screenshot', 'ss_screenshot_shortcode'); function ss_screenshot_shortcode($atts){ $width = intval($atts['width']); $width = (100 <= $width && $width <= 300) ? $width : 200; $site = trim($atts['site']); if ($site != ''){ $query_url = 'http://s.wordpress.com/mshots/v1/' . urlencode($site) . '?w=' . $width; $image_tag = '<img alt="' . $site . '" width="' . $width . '" src="' . $query_url . '" />'; echo '<a href="' . $site . '">' . $image_tag . '</a>'; }else{ echo 'Bad screenshot URL!'; } }
My guess is I would first have to create a special field type for this to work, so I would appreciate help with that too if this is possible.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.