Notice thrown when creating numeric pagination on custom query

Sounds like you’ve already done all of the heavy lifting. function_exists() expects a string for the first parameter, so custom_pagination should be 'custom_pagination' (add quotes):

if ( function_exists( 'custom_pagination' ) ) { ... 

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)