It's best if you first know what stages have a wall.
Now if your talking about wall clinging after an ES, what you need to do is be perfectly vertical with the wall. A little tilt this way or that can either hit or miss, so its best if you go completely flat in the air.
If your just talking about jumping and clinging, the same concept can apply, just keep lucario at an equal level to the wall your trying to cling to, and then hold the joystick to the angle to the wall. It's like your pushing lucario against the wall, and in return he's just wall clinging.
So remember to:
1) keep lucario equally vertical to the wall
2) Hold the joy stick in the direction of the wall to cling. (this is just a precaution to keep lucario on the wall, I dunno if you really need to hold the stick in the direction at all)
3) Practice
-t2