how should i get products based on tags in woocommerce
how should i get products based on tags in woocommerce
how should i get products based on tags in woocommerce
Custom shortcode with < in content
How to use shortcode to get the second to newest post?
Why does my shortcode query not working with search term
If the error goes away when you change the theme, it’s possible that the issue is related to the child theme. It’s important to note that deleting the child theme will not delete any information stored in the database, as that information is stored separately from the theme files. However, if you delete the child … Read more
It makes sense to look at the PHP function rawurldecode, which decodes URL-encoded strings. https://www.php.net/manual/en/function.rawurldecode.php For example, echo rawurldecode(get_permalink($post->ID)); will show the decoded post URL. But this isn’t really needed in hyperlink code. Sorry I didn’t just write a comment, I don’t have enough points for that option.
How to edit a widget code?
unfortunately I have no success with get_post_type() but get_queried_object() helped. I changed the code to: function post_type_slug() { $post_type = get_queried_object(); $post_type = $post_type->rewrite[‘slug’]; return $post_type; } add_shortcode(‘pts’, ‘post_type_slug’); and it’s working in text widget now.
Thank you, @Howdy_McGee! current_filter() is exactly what I’ve been looking for. Here is what I did: function french_example( $atts , $content = null ) { $currentFilter = current_filter(); if ($currentFilter == the_content) { return ‘<span class=”ex” xml:lang=”fr” lang=”fr”>’ . do_shortcode($content) . ‘</span>’; } elseif ($currentFilter == the_title) { return ‘<span class=”ex” xml:lang=”fr” lang=”fr”>’ . do_shortcode($content) … Read more
Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode