shortcode atts not working
shortcode atts not working
shortcode atts not working
I’ve finally found a working solution : function tag_cloud_shortcode($atts) { extract(shortcode_atts(array( ‘cat’ => ” ), $atts)); $query_args = array( ‘cat’ => $atts, ‘posts_per_page’ => -1 ); $custom_query = new WP_Query( $query_args ); if ($custom_query->have_posts()) : while ($custom_query->have_posts()) : $custom_query->the_post(); $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { $all_tags[] = $tag->term_id; } } endwhile; … Read more
Shortcodes are not a programing language, and anything that looks like something a non technical person will not be able to maintain, should never be created/used. Create one shortcode that does what you need. Since in any case a programmer will be needed to manipulate what you are showing in the question, it can be … Read more
IMO you need to create individual shortcodes for UL, OL and LI to make it sample. Shortcode for UL. function shortcode_ul( $atts , $content = null ) { return ‘<ul>’ . do_shortcode( $content ) .'</ul>’; } add_shortcode( ‘ul’, ‘shortcode_ul’ ); Shortcode for LI function shortcode_li( $atts , $content = null ) { return ‘<li>’ . … Read more
WordPress 4.8.2 specifically restricts the convenient usage of numbered placeholders like %1$s, %1$d, %1%f in WPDB::prepare. (core.trac.wordpress.org/ticket/41925). To avoid usage of numbered placeholders, SQL query has to be rearranged to just use only one %s. SELECT DISTINCT t.`Date`, y.* FROM `table` t LEFT JOIN `table` y ON (t.`Date` = y.`Date`) WHERE t.`country` = %s ORDER … Read more
Can we add a single caption to the gallery shortcode?
Not enough code in the question to pinpoint the problem, but I would call what you are trying to do “shady”. Usage of do_shortcode should be confined to extreme cases when it is impossible, or extremely hard, to do anything else, as using it is the less evil equivalent of using eval. What you should … Read more
Ok I found a solution by myself just by using this plugin: https://wordpress.org/plugins/enable-shortcodes-inside-widgetscomments-and-experts/
Gravity Forms will be your solution, but you will have to do some custom notifications. You will also need User Registration Add-On the https://www.gravityforms.com/add-ons/user-registration/ What you will need to do is: Create a hidden field called for example “current user email” and allow it to be populated automatically. Create a user registration feed and select … Read more
shortcode is not rendered