Normally triggers would run on a table on BEFORE or AFTER an insert, update or delete of a row. There are several options that allow you to decide on when to call the trigger.
Updating the row currently being inserted before insert would be a typical way to use a trigger. Then it is just a matter of creating a trigger on the actual table:
CREATE TRIGGER trig_title_upweight_trigger
BEFORE INSERT OR UPDATE
ON pg_rocks_post
FOR EACH ROW
EXECUTE PROCEDURE title_upweight_trigger();