I believe the most common are still cross-site scripting / cross-site request forgery, various injection attacks (sql, DOM, xml, web services etc.), denial of service, buffer overflows ... (social engineering too, but that's outside the scope of what you're asking.)
Wordpress or other CMS's and software get vulnerabilities from errrors and oversights in implementing the language they're built in / platform they are running on.; So various releases of Wordpress code, would potentially have php/html/mysql issues
A lot of avoiding vulnerabilities comes down to careful programming and code audits. Validate data properly, use best programming practices and "safe" functions of whatever language ... and remember that any time you're using 3rd party services, some control is out of your hands.
If you're the type who learns by doing, Google appspot has a codelab called Google Gruyere.