Display tags cloud from a specific category ID with a shortcode

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

Customise standard lists within my shortcode

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

How to process a single attribute in a SQL request twice times?

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

Shortcode not interpreted if parameter set

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

Send Mail with link to current_user

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

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