Can I wrap an unordered list inside a shortcode?

You can capture the list in a variable, rather than echo it: $list=”<ul class=”strong”> <li>” . get_field( ‘highlights_list_item#1’ ) . ‘</li> <li>’ . get_field( ‘highlights_list_item#2’ ) . ‘</li> </ul>’; echo do_shortcode( ‘[one_half]’ . $list . ‘[/one_half]’ ); Note the use of get_field() rather than the_field(), which returns a custom field value as opposed to displaying … Read more

Change WordPress Shortcode added in to post

remove_shortcode( ‘gallery’ ); add_shortcode( ‘gallery’, function( $atts ) { $atts = shortcode_atts( array( ‘ids’ => ” ), $atts ); return do_shortcode( “[wp-slideshow include=\”$atts[ids]\”]” ); } ); This may be better than replacing the gallery shortcode as if you decide to change plugin you will have the standard gallery shortcode which many plugins will work with … Read more

Create shortcode in Child Theme?

Shortcodes don’t ‘echo’, they need to ‘return’ something. So I guess it will work if you put your functions content between ob_start and ob_get_clean so you return everything inbetween: function yourfunction(){ ob_start(); /* insert here the code of your function */ $output = ob_get_clean(); return $output; }

How to add class or id to shortcode HTML elements?

You could abandon the shortcodes and use HTML. <div class=”row full-width whatever”> [one_third]1[/one_third] [one_third]2[/one_third] [one_third]3[/one_third] </div> OR you could easily just wrap all of your code in another div and target the [row] element through CSS: <div class=”your_special_wrapper”> [row] [one_third]1[/one_third] [one_third]2[/one_third] [one_third]3[/one_third] [/row] </div> <style> .your_special_wrapper div{ /*whatever css you need*/ } </style>

How to Modify WordPress Default Image Gallery Shortcode

You could try this plugin: https://wordpress.org/plugins/wp-pagination/ It makes a javascript approach to paging. For my projects i always started to build galleries using custom post types or repeaterfields with acf: http://www.advancedcustomfields.com/add-ons/repeater-field/ WordPress built in gallery function is… well almost unfunctional. 🙂

WordPress Shortcode callback function with a plugin

Rick’s answer is incorrect, as the documentation for add_shortcode specifies that “the function called by the shortcode should never produce an output of any kind”. Instead, you should return the text that you want the shortcode to output. So, try having display_sheet_form return that text instead of echoing it.

Shortcodes won’t work on live environment

So this turned out to be the problem: After running using WP_DEBUG on the live site it turned out $this was not defined in the following line: public function __construct(){ add_action(‘init’, function(){ add_shortcode(‘bbit’, array($this, ‘shortcode_handler’)); }); } shortcode_handler is a non-static function here, and this code was all called in a static context. It seems … Read more

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