sushma_proach

add shprtcode apply any time

May 30th, 2016
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. add_shortcode('picture', 'random_picture');
  2.  
  3. function random_picture($atts) {
  4.    extract(shortcode_atts(array(
  5.       'width' => 400,
  6.       'height' => 200,
  7.    ), $atts));
  8. return '<img src="http://lorempixel.com/'. $width . '/'. $height . '" />';
  9. }
  10.  
  11. links .. https://codex.wordpress.org/Shortcode_API
  12. how to create a plugin....  https://www.elegantthemes.com/blog/tips-tricks/how-to-create-a-wordpress-plugin.
Add Comment
Please, Sign In to add comment