While loop shortcode problem

You don’t use global $wp_query object anywhere in your code, so there is no point in calling wp_reset_query(). On the other hand, you do use global $post variable, so after your code you should restore it’s original value with wp_reset_postdata();. So change wp_reset_query() to wp_reset_postdata() and it should be OK. And one more thing… Shortcodes … Read more

Shortcodes in excerpts returning empty string

If you’re using auto-generated excerpts, then all shortcodes will be removed (https://developer.wordpress.org/reference/functions/the_excerpt/): An auto-generated excerpt will also have all shortcodes and tags removed. It is trimmed down to a word-boundary and the default length is 55 words. For languages in which words are (or can be) described with single characters (ie. East-Asian languages) the word-boundary … Read more

Detecting embeded video format

so you place your video inside a shortcode and then you can run a filter on that shortcode function. works like this (to be placed inside functions.php or some custom plugin): function so327822_wp_video_shortcode($output, $atts) { //get video ID by src $video_id = attachment_url_to_postid( $atts[‘src’] ); //get video meta $video_meta = wp_get_attachment_metadata( $video_id ); //uncomment next … Read more

menu item to display the most recent post

If you want to perform any redirects, you have to send your header before site sends any output. Shortcodes are run when the content is obtained, parsed and printed. So the site will already be partially sent to the browser, so you won’t be able to perform any redirects any more. So you should run … Read more

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