Police seized around £500 worth of cannabis and sums of cash when they searched a family home.
A court heard police executed a search warrant at the property on Haughton Avenue, Knottingley, on June 6 last year where Daniel Price lived with his partner and two young children.
Leeds Crown Court heard officers discovered around 100g of the class B drug and sums of cash in various parts of the house.
A mobile phone was seized and was found to contain around 100 text messages relating to drug supply.
Price, 25, was arrested and initially claimed the cannabis was for his own personal use.
He refused to make further comment when questioned about the mobile phone messages.
Price pleaded guilty to possession of cannabis with intent to supply.
The court heard Price had been using around £200 worth of the drugs each week as a result of a tragedy in his family and initially began growing the drug to fund his own habit.
Joanna Shepherd, mitigating, said Price pleaded guilty to the offence at an early stage and had no other convictions for drug offences.
She added: “He is seeking help and realises that he has a problem with cannabis use.
“He needs extra help and believes that he may be able to access that if he is allowed to retain his liberty.”
Price was given an eight month prison sentence, suspended for 12 months. He was also ordered to do 180 hours unpaid work and take part in a drug rehabilitation programme.