Video shortcode, option are not rendered

You haven’t assign for $atts. So suprised that the poster can work correctly. function video_custom($atts) { extract(shortcode_atts(array( ‘option’ => ”, ‘poster’ => ”, ‘src’ => ”, ‘type’ => ”, ), $atts)); return ‘<div class=”d-flex justify-content-center”><video class=”wp-video” ‘ . $option . ‘ poster=”‘ . $poster . ‘”><source src=”‘ . $src . ‘” type=”video/’ . $type . … Read more

Dynamic number within shortcode

Shortcodes are plain text wrapper made exactly for cases when PHP code is not available or should not be used. You can concatenate that to string and evaluate it with do_shortcode(). You can look up function that powers shortcode (set up with add_shortcode()) and use it in PHP code directly.

hard code shortcode only on specific category

If you’re embedding the code directly into the template file, why bother with shortcodes? Simply extract the code from the add_shortcode() function call, and add it to your template, wrapped in an appropriate conditional tag, such as in_category(), e.g.: if ( in_category( $cat ) ) { // put shortcode code here } Note: the $cat … Read more

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