SEO Friendly URL on dynamic product page produced via shortcode

Your rule needs a little tweak. You also need to add id to valid query vars. function wpd_test_rule() { add_rewrite_tag( ‘%id%’, ‘([0-9]+)’ ); add_rewrite_rule( ‘^product/([0-9]+)/([^/]+)/?$’, ‘index.php?page_id=5&id=$matches[1]’, ‘top’ ); } add_action( ‘init’, ‘wpd_test_rule’ ); Note that WordPress doesn’t put query vars in $_GET, you’ll need to adjust your code to use get_query_var(‘id’) to fetch the value. … Read more

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