How To Conditionally Include A Short Code Depending On The HTTP_REFERER [closed]
How To Conditionally Include A Short Code Depending On The HTTP_REFERER [closed]
How To Conditionally Include A Short Code Depending On The HTTP_REFERER [closed]
Reloading a Mediaelement audio player
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
add action only if gallery shortcode attribute is equal to?
Gutenberg Block with Select from JSON-File
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
how to format / execute post content and shortcode?
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
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
One way of doing it would be to modify your current code and add the links in there: function category_name_shortcode() { global $post; $post_id = $post->ID; $catName = “”; foreach((get_the_category($post_id)) as $category){ $catName .= ‘<a href=”‘ . get_term_link($category) . ‘”>’ . $category->name . ‘</a>, ‘; } return $catName; } add_shortcode( ‘post_category’, ‘category_name_shortcode’ ); But there’s … Read more