Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('the_content', 'custom_filter');
- function custom_filter($content) {
- global $post;
- if($post->post_type == 'post') {
- $var = 'This is a post';
- } elseif($post->post_type == 'page') {
- $var = 'This is a page';
- } else {
- $var = 'This is some custom post type, named '.$post->post_type;
- }
- return $content.$var;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement