Shortcode to insert

Best solution for what you want to accomplish which is essentially to make the next page feature more user friendly for your authors is to add a TinyMCE button that will do this for you. This may be a bit complicated so hold your hat. To avoid this answer being the length of a thesis, … Read more

Are shortcodes case-sensitive?

Short Answer Yes, shortcodes are case sensitive Longer Answer It’s really easy to build a test case for this and see. <?php add_shortcode(‘sOme_ShOrTcOdE’, ‘wpse102375_shortcode’); function wpse102375_shortcode($args, $content=null) { return ‘yep’; } Longest Answer Read the source. The “magic” with shortcodes happens in do_shortcode, so let’s take a look at that. <?php // wp-includes/shortcode.php function do_shortcode($content) … Read more

Shortcode output always showing at top of page

I think your problem is with the $output = include …. statement. include() returns true or false based whether it was successful – not the content of the file being included. Use output buffering to get the content. function service_shortcode_index() { global $content; ob_start(); include ( TEMPLATEPATH . ‘/service.php’ ); $output = ob_get_clean(); return $output; … Read more

Nested Shortcode Detection

From: http://codex.wordpress.org/Shortcode_API#Limitations The shortcode parser correctly deals with nested shortcode macros, provided their handler functions support it by recursively calling do_shortcode() It will not let you nest the same shortcode inside another though: However the parser will fail if a shortcode macro is used to enclose another macro of the same name Assuming you won’t … Read more

List of all inbuilt WordPress shortcodes

You can actually list all of the available shortcodes for your WordPress installation by using the following code: <?php global $shortcode_tags; echo ‘<pre>’; print_r($shortcode_tags); echo ‘</pre>’; ?> It will show the main WordPress shortcodes plus any shortcodes for installed plugins which can be handy too!

Shortcode output appears before post body [duplicate]

I have had this problem before: shortcodes shouldn’t display any content (using print or echo), instead return the content to be outputted. If it’s too much trouble converting all of your output statements, or you need to use a function that will always display the output, you can use output buffering. A buffer will ‘catch’ … Read more

How to Output HTML tags in do_shortcode?

Yes it is possible. There are two ways that I can think of at this moment. First follow what the codex says Shortcodes. Basically you just wrap your html in ob_start(); this will return the html as a string so you can echo it. function my_shortcode() { ob_start(); ?> <HTML> <here> … <?php return ob_get_clean(); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)