Support

Account

Home Forums General Issues Dynamic whatsapp number with fixed url and appended text Reply To: Dynamic whatsapp number with fixed url and appended text

  • I leave the exact code in case someone needs it

    // Prepend shortcode
      function https_wa_shortcode() {
        return 'https://wa.me/549';
    }
    add_shortcode('https_wa', 'https_wa_shortcode');
    
    // Append shortcode
      function hi_wa_shortcode() {
        return '?text=Hi! ';
    }
    add_shortcode('hi_wa', 'hi_wa_shortcode');
    
    // Post title shortcode
    function post_title_shortcode(){
        return get_the_title();
    }
    add_shortcode('post_title','post_title_shortcode');
    
    // Append shortcode
      function text_wa_shortcode() {
        return ', here is the last part of the text.';
    }
    add_shortcode('text_wa', 'text_wa_shortcode');