Does Continually Passing wind Invalidate Wudu?
Question

I have this condition called irritable bowel syndrome. Some of its symptoms include: feelings of bloatedness and the release of gas, which means that whenever I perform wudu. Sometimes I have to keep renewing it constantly, sometimes at least 5 times because of the release of gas, during wudu, after wudu or during prayer. You see, I don't get it all the time but quite a lot of the time, so it stops me from performing taraweeh etc., and even though I'm a sister, I still like to attend Friday prayer but because of this I can't. Also the gas is not just normal gas, the smell can be quite bad.
Praise be to Allah.We ask Allah to heal our sister, and may Allah reward her with good for her keenness to understand the rulings of her religion and her not being shy to do so, so that she may clearly understand her religion. 
Doubts about breaking wudu
A person who is praying may sometimes imagine that he has passed wind whilst praying , when that has not in fact happened. This may be due to the whispering of the Shaytan who wants to spoil his prayer and make him not focus with proper humility in it. The worshipper should not stop praying unless he is certain that something has come out of him. 
It was narrated from ‘Abbad ibn Tamim that his paternal uncle asked the Messenger of Allah (peace and blessings of Allah be upon him) about a man who thought he felt something whilst praying. He said: “He should not stop praying unless he hears a sound or detects an odour.” (Narrated by al-Bukhari, 137 (this version was narrated by him); Muslim 362) 
What is meant by the hadith is not that the ruling depends on hearing a sound or detecting an odour, rather what is meant is being certain that something has come out even if one does not hear a sound or detect an odour. (See Sharh Muslim by al-Nawawi, 4/49)
The basic principle concerning the worshipper is that if he has done wudu, then his wudu cannot be broken by something doubtful , rather he must be certain that he has broken it. If he is certain that he has broken his wudu, then he should stop praying and do wudu again. 
What breaks or invalidates wudu can only be that which comes out of the front of back passage for certain, so that one is sure of it and not doubtful or confused. Simply feeling that there is gas in one’s stomach is not one of the things that invalidate wudu, unless something comes out. 
Cases of urinary incontinence
The ruling on the gas of which you complain is the same as the rulings for those who suffer from istihadah (non-menstrual vaginal bleeding) or urinary incontinence. (al-Sharh al-Mumti’, 1/437) 
Two scenarios may apply: 
The first is: 
There may be a time when it stops, such as if you pass wind , then it stops for a while, during which time you can do wudu and pray, then it starts again. In this case you have to do wudu and pray during the time when it stops. 
The second is: 
It may be continuous and there may be no time when it stops; it could happen all the time. In this case you should do wudu for each prayer after the time for the prayer begins, and pray with this wudu; it does not matter whatever comes out of you even if that happens during wudu or during the prayer. 
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said: 
“Whoever cannot keep his wudu for the duration of the prayer should do wudu and pray, and it does not matter what comes out of him during the prayer, and his wudu is not invalidated by that, according to the consensus of the imams. The most he has to do is to do wudu for each prayer.” (Majmu’ al-Fatawa, 21/221)
Ruling on urinary incontinence
The Standing Committee was asked about a man who suffers from urinary incontinence that appears for a short while after he urinates; if he waits for the urine to stop, the prayer in congregation will be over. What is the ruling? 
The Committee replied: 
“If he knows that the incontinence will stop, it is not permissible for him to pray in this condition seeking the virtue of the jama'ah. Rather he has to wait until it stops, then he should cleanse himself with water (istinja ) and pray, even if he has missed the prayer in congregation. He should hasten to cleanse himself with water and do wudu after the time for prayer begins, hoping that he will be able to offer the prayer in congregation.” 
It also says in Fatawa al-Lajnah al-Daimah: 
“The basic principle concerning emission of wind is that it invalidates wudu, but if a person passes wind continually, he has to do wudu for each prayer when he wants to pray, then if wind comes out of him whilst he is praying, that does not invalidate it; he has to continue with his prayer until he completes it. This is a dispensation granted by Allah to make things easier for His slaves and not to cause them any hardship, as Allah says (interpretation of the meaning): 
“Allah intends for you ease.” [al-Baqarah 2:185] 
“and has not laid upon you in religion any hardship.” [al-Hajj 22:78]” (al-Lajnah al-Daimah li’l-Buhuth, 5/411) 
Going to mosques with offensive odours 
With regard to your going to the mosque with this smell, that is not permissible because the mosques must be protected from all offensive odours, because that disturbs the worshippers, and it offends the noble angels. 
The Prophet (peace and blessings of Allah be upon him) forbade those who eat garlic or onions to come near the mosques. Al-Bukhari and Muslim narrated from Jabir ibn ‘Abd-Allah that the Prophet (peace and blessings of Allah be upon him) said: “Whoever eats garlic or onions, let him keep away from us (or he said: let him keep away from our mosque) and sit in his house.” 
And Muslim (564) narrated that the Prophet (peace and blessings of Allah be upon him) said: “Whoever eats onions and garlic and leeks, let him not come near our mosque, for the angels are offended by that which offends the son of Adam.” 
The Prophet (peace and blessings of Allah be upon him) used to command that anyone on whom he detected the odour of garlic and onions be asked to leave the mosque. 
Muslim (567) narrated that ‘Umar ibn al-Khattab said: I saw the Messenger of Allah (peace and blessings of Allah be upon him), if he detected the smell (of onions or garlic) on a man in the mosque, he would order that he be taken out to al-Baqi’ (the cemetery in al-Madinah). 
And Allah knows best.