advantage_page_title

The Advantage advantage page title function.

Description

advantage_page_title(); 

Usage

  1. if ( !function_exists( 'advantage_page_title' ) ) { 
  2. require_once '/inc/lib-content.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = advantage_page_title(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/lib-content.php  
  1. function advantage_page_title() { 
  2. global $advantage_options, $post; 
  3. if ( ! have_posts()) return; 
  4. if ( is_single() ) { 
  5. printf( '<h1>%1$s</h1>', get_the_title() );  
  6. } elseif ( is_page() ) { 
  7. $pagetitle = get_post_meta( $post->ID, '_advantage_title', true ); 
  8.  
  9. if ( empty( $pagetitle ) ) 
  10. printf( '<h1>%1$s</h1>', get_the_title() ); 
  11. } elseif ( is_search() ) { ?> 
  12. <h1><?php printf( __( 'Search Results for: %s', 'advantage' ), '<span>' . get_search_query() . '</span>' ); ?></h1>  
  13. <?php 
  14. } elseif ( is_author() ) { 
  15. the_post(); ?> 
  16. <h1><?php printf( __( 'Author Archives: %s', 'advantage' ), '<a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a>' ); ?></h1> 
  17. <?php rewind_posts();  
  18.  
  19. elseif ( is_category() ) { 
  20. $category_description = category_description(); 
  21. if ( empty( $category_description ) ) { ?>  
  22. <h1><?php printf( __( 'Category Archives: %s', 'advantage' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1> 
  23. <?php 
  24. } else 
  25. echo '<h1>'. $category_description .'</h1>';  
  26. elseif ( is_tag() ) { 
  27. $tag_description = tag_description(); 
  28. if ( empty( $tag_description ) ) { ?>  
  29. <h1><?php printf( __( 'Tag Archives: %s', 'advantage' ), '<span>' . single_tag_title( '', false ) . '</span>' ); ?></h1> 
  30. <?php 
  31. } else 
  32. echo '<h1>'. $tag_description .'</h1>';  
  33. elseif ( is_archive() ) { 
  34. echo '<h1>'; 
  35. if ( is_day() )  
  36. printf( __( 'Daily Archives: %s', 'advantage' ), '<span>' . get_the_date() . '</span>' ); 
  37. elseif ( is_month() ) 
  38. printf( __( 'Monthly Archives: %s', 'advantage' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'advantage' ) ) . '</span>' ); 
  39. elseif ( is_year() ) 
  40. printf( __( 'Yearly Archives: %s', 'advantage' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'advantage' ) ) . '</span>' ); 
  41. else 
  42. the_title();  
  43. echo '</h1>';