Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey there, we’d like to know a wordaround either ??

    Hi,
    I’m testing a workaround;
    In functions.php, add this code;

    function phone_before_after($content) {
      $phoneFromHere="[vc_row][vc_column width=\"1/1\" el_class=\"phonefromhere\"][/vc_column][/vc_row]";
      if (strpos($content, $phoneFromHere) !== false) {
        $content = str_replace($phoneFromHere, "[/notphone][phone]", $content);
        $beforecontent = "[notphone]";
        $aftercontent = "[/phone]";
        $fullcontent = $beforecontent . $content . $aftercontent;
      }else{
        $fullcontent=$content;
      }
      return $fullcontent;
    }
    add_filter("the_content", "phone_before_after");

    in Visual Composer;
    I add the default content first, then at the end, an empty row where I add the class “phonefromhere” to the empty column.
    [edit]: And after this empty row, I add the part meant for phones.

    This way I get [notphone][/notphone] on the first part, and [phone][/phone] on the last part of the page.

    Anyone have an update here?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shortcodes disappearing with Visual Composer’ is closed to new replies.