Find a very simple way to do this. Exemple:
[hide for="logged"]<em>Please login</em>[/hide]
[hide for="!logged"]New post[/hide]
But it looks like hide this replace hidden text by `</br>’
How can I avoid this bcause it create bad text design ?
mmm…easy ! : do not let space between the two hidden part if you use visual composer otherwhise VC will add space:
[hide for=”logged”]Please login[/hide][hide for=”!logged”]New post[/hide]
Yes, that’s exactly the way you should do it. The issue with spacing has a lot more to do with the way WordPress parses the markup from shortcodes than how particular shortcodes process their own HTML, so having any shortcode in a separated line will cause an additional line break.