fixed issues with slug generation for posts and pages

Signed-off-by: ramsay <ramsaylanier@gmail.com>