[Plugin: Shortcodes Pro] shortcode to php functions (and beyond)
-
Hi
I been looking for a quick solutions to allow me to code a bit quicker with images within the page and post editor
i have a theme and in which a image directory lies
wp-content/theme/imagesi want to basically upload site images manual when i am doing my design then use shortcode pro to allow me to tag and insert the
<?php bloginfo('template_directory');?>snippet in to the editor thus making a standard “site dynamic” shortcode, i can use for any theme over and over againstage 1 : just get the image in to the page
thus in the editor[timg]logo.png[/timg]would produce output (user browser)
<img src="http://demosite.co.uk/wp-content/theme/image/logo">
in the browserthe second stage to take this further is having parameters for alt=”” title=”” width=”” height=””/> being allowed at the start of the shortcode
finally the 3rd stage would be to allow the setting at the time of the shortcode for the parameters after, but if no value is entered then it basically removes them from the output
the 4th stage if the paramaters settings can be set to optional tickbox at the time of designing the code for good enforcement
ie all images should have an alt value, even if it is not entered at the time of entering the shortcode then it would still create
<img src="http://demosite.co.uk/wp-content/theme/image/logo" alt="" />even if no value was specified through the parameters section it would render as above so at testing stage you would be reminded of all the places where the tag needed to be filled in, in this case to help with seo
not asking much am i
would love to hear your help and views including matts 🙂
regards
devo
The topic ‘[Plugin: Shortcodes Pro] shortcode to php functions (and beyond)’ is closed to new replies.