Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Return the title for the page
- * @return String the title.
- */
- public function the_title( $head = false ){
- $title = '';
- //Copy Pasta from Andrew Rickman's ported theme, Dilectio http://www.habari-fun.co.uk/converting-wordpress-themes-to-habari-file-names
- //check against the matched rule
- switch( $this->matched_rule->name ){
- case 'display_404':
- $title = 'Error 404';
- break;
- case 'display_entry':
- $title .= $this->post->title;
- break;
- case 'display_page':
- $title .= $this->post->title;
- break;
- case 'display_search':
- $title .= 'Search for ' . ucfirst( $this->criteria );
- break;
- case 'display_entries_by_tag':
- $title .= ucfirst( $this->tag ) . ' Tag';
- break;
- case 'display_entries_by_date':
- $title .= 'Archive for ';
- $archive_date = new HabariDateTime();
- if ( empty($date_array['day']) ){
- if ( empty($date_array['month']) ){
- //Year only
- $archive_date->set_date( $this->year , 1 , 1 );
- $title .= $archive_date->format( 'Y' );
- break;
- }
- //year and month only
- $archive_date->set_date( $this->year , $this->month , 1 );
- $title .= $archive_date->format( 'F Y' );
- break;
- }
- $archive_date->set_date( $this->year , $this->month , $this->day );
- $title .= $archive_date->format( 'F jS, Y' );
- break;
- }
- if ( $head ){
- return ( empty($title)) ? Options::get( 'title' ) : $title . ' - ' . Options::get( 'title' );
- }
- return $title;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement