can I do something like that? to pass arguments to my function? I already studied add_action doc but did not figure out how to do it. What the exact syntax to pass two argum
Instead of:
add_action('thesis_hook_before_post','recent_post_by_author',10,'author,2')
it should be:
add_action('thesis_hook_before_post','recent_post_by_author',10,2)
...where 2 is the number of arguments and 10 is the priority in which the function will be executed. You don't list your arguments in add_action. This initially tripped me up. Your function then looks like this:
function function_name ( $arg1, $arg2 ) { /* do stuff here */ }
Both the add_action and function go in functions.php and you specify your arguments in the template file (page.php for example) with do_action like so:
do_action( 'name-of-action', $arg1, $arg2 );
Hope this helps.