Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this can go in the themes functions.php
- // or into a site specific/custom functions plugin.
- function modified_ee_title($title, $sep) {
- global $post;
- $postype = get_post_type( $post );
- //if not an EE event, return
- if($postype != "espresso_events" || !in_the_loop() ) { return $title; }
- //get the custom/meta fields
- $meta = get_post_custom($post->id);
- //if the meta field called abc doesnt exist, return
- //obviously change abc to the actual meta key...
- if( !isset($meta['abc']) ) { return $title; }
- //modify the title
- $title = $title . ' ' . $meta['abc'][0];
- //return the modified title
- return $title;
- }
- add_filter( 'the_title', 'modified_ee_title', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement