Colon is Missing In My Website Url in WordPress
Have you checked your wp_options table under the column “site_url”. The Colon can be missing in database table.
Have you checked your wp_options table under the column “site_url”. The Colon can be missing in database table.
If it is a shortcode you’re developing yourself, then you could add the url parameter checking / getting for example like this, add_shortcode( ‘EmbedMe’, ’embedme_callback’ ); function embedme_callback( $atts ) { $defaults = array( ‘file’ => ” ); $atts = shortcode_atts( $defaults, $atts, ‘EmbedMe’ ); if ( ‘source’ === $atts[‘file’] && ! empty( $_GET[‘source’] ) … Read more
Remove shortcodes that are different (but same pattern) in each post
You can use woocommerce_shortcode_products_query filter to change orderby argument. it will set orderby as post__in in [products] shortcode query. I have tested and it is working fine for me. you can take reference from below code and adjust code as per your need. Let me know if this works for you! add_filter( ‘woocommerce_shortcode_products_query’, ‘woocommerce_shortcode_products_orderby_post_in’ ); … Read more
you can make a string and parse it. you start with [foo people=”name:john,age:51|name:jenny,age:62″ something=”custom”] and you use this code add_shortcode(“foo”, function ($attr, $content, $tag) { // parsing attributes $attr[“people”] = explode(“|”, $attr[“people”]); $attr[“people”] = array_map(function ($e) { $tab = []; foreach (explode(“,”, $e) as $raw_tab) { $tab2 = explode(“:”, $raw_tab); $tab[$tab2[0]] = $tab2[1]; } return … Read more
You don’t have to use do_shortcode inside your shortcode callback function. But if you don’t do this, then you won’t be able to nest shortcodes, so other shortcodes added on the site won’t work inside it. Let’s say your shortcode callback looks like this: function a_shortcode($atts = [], $content = null) { //use content here, … Read more
WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
Products Shortcode is Displaying Single Product Page Price for all Products [closed]
After a while i got it : In the functions.php i added the line : wp_localize_script(‘vue_wordpress.js’,’sharedData’,array( ‘contactForm’ => do_shortcode(‘[contact-form-7 id=”5″ title=”Formulário de contacto 1″]’) ) to the already existing function i had: function vue_wordpress_scripts() { // Styles wp_enqueue_style( ‘style.css’, get_template_directory_uri() . ‘/style.css’ ); // wp_enqueue_style(‘vue_wordpress.css’, get_template_directory_uri() . ‘/dist/vue-wordpress.css’); // wp_enqueue_style(‘global’,get_template_directory() . ‘/styles/menu.css’ ); //copiar este … Read more
It’s an OK practice but in some cases could be turned to a worst case scenario! Using shortcodes to generate blocks of HTML is the reason they exist, especially when you need some dynamic HTML generation (using attributes in the shortcode). In conclusion, a normal shortcode usage is totally OK, however you should avoid putting … Read more