What is short code for following?

You are correct, [login_form] is the shortcode that you should use. From the Shortcode API The add_shortcode function is used to register a shortcode handler. It takes two parameters: the shortcode name (the string used in a post body), and the callback function name. From what I can understand is that the shortcode calls a … Read more

Creating custom shortcode

You are passing the parameters wrong, try with something like this: function get_telephone($attrs) { $attr = shortcode_atts( array( ‘name’ => ‘John Doe’ ), $attrs ); return attr[‘name’]; } add_shortcode( ‘telephone’, ‘get_telephone’ ); In the post you call the shortcode like this: [telephone name=”Jose”] Anyway, inside the get_telephone function you should add some logic to get … Read more

How can I define the output of shortcode attribute value?

According to Codex: function shortcode_function_name( $atts ) { $atts = shortcode_atts( array( ‘attr1’ => ”, ), $atts, ‘your-shortcode-name’ ); return ‘<div id=”‘.$atts[‘attr1′].'”>Your Predefined Content</div>’; } add_shortcode( ‘your-shortcode-name’, ‘shortcode_function_name’ ); Adding [your-shortcode-name attr1=”Value1″] to the content of any post/page will give the following output <div id=”Value1″>Your Predefined Content</div>. Adding [your-shortcode-name attr1=”Value1″] to the content of any … Read more

Only execute specific shortcodes

It’s easier to remove specific shortcodes than it is to remove_all_shortcodes() and enable specific shortcodes. To disable specific shortcodes from display everywhere, you would use the following: <?php add_filter( ‘the_content’, ‘oxo_remove_shortcodes’, 0 ); function oxo_remove_shortcodes( $content ) { /* Add the shortcodes that you would like to remove to the array below. */ $shortcode_tags = … Read more

Output html source tags inside shortcode

Try the following code: function caption_shortcode( $atts, $content = null ) { $content = do_shortcode($content); return ‘<span itemprop=”articleSection”>’. str_replace( array( ‘<‘, ‘>’ ), array( ‘&lt;’, ‘&gt;’ ), $content ) .'</span>’; } add_shortcode( ‘source’, ‘caption_shortcode’ ); remove_filter( ‘the_content’, ‘wpautop’ ); remove_filter( ‘the_excerpt’, ‘wpautop’ );

Class variables in shortcodes

Thanks to the response by @bueltge : Added extra line in the __construct() function: public function __construct() { $this->var = $this->shortcode_1(); //added add_shortcode( ‘the_single’, array( $this, ‘shortcode_2’ )); }

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