Why does my shortcode query not working with search term
Why does my shortcode query not working with search term
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
Solved with “Royal Elementor Addons” plugin
You’d have to use add_rewrite_rule so you can capture your desired url match and pass it on query_vars Something like; add_action(‘init’, function() { add_rewrite_rule(‘ip/(.+)/?$’,’index.php?ip_search=$matches[1]’,’top’); }); add_filter( ‘query_vars’, function( $vars ) { $vars[] = ‘ip_search’; return $vars; }); dont forget to flush the rewrite rule once you added your own rule, change the permalink settings back … Read more
I think the most simple approach (if you’re able to add some JS) is to use custom classes for your buttons and blocks that can be settled through advanced settings in block editor. Then a really basic JS snippet can do the trick. Here’s an example in vanilla JS with an IFFE that takes care … Read more