Skip to content

Commit

Permalink
Final optimalization for the breadcrumbs code
Browse files Browse the repository at this point in the history
  • Loading branch information
dziudek committed Apr 24, 2013
1 parent fc1758e commit e6447c5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions MeetGavernWP/gavern/helpers/helpers.layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,14 @@ function gk_breadcrumbs_output() {
// return the Home link
$output .= '<a href="' . home_url() . '" class="gk-home">' . apply_filters('gavern_breadcrumb_home', get_bloginfo('name')) . "</a>";
// if page is category or post
if (is_category() || is_single()) {
if (is_category() || is_singular()) {
// return the category link
$output .= get_the_category_list(' ');
// if it is a post page
if (is_single() || is_page()) {
if (is_singular()) {
// return link the name of current post
$output .= '<span class="gk-current">' . get_the_title() . '</span>';
}
}
// if it is a normal page
} elseif (is_page()) {
// output the page name
Expand All @@ -387,9 +387,6 @@ function gk_breadcrumbs_output() {
} elseif(is_search() && isset($_GET['s'])) {
// output the author name
$output .= '<span class="gk-current">' . __('Searching for: ', GKTPLNAME) . strip_tags($_GET['s']) . '</span>';
} elseif(is_attachment()) {
// output the attachment page name
$output .= '<span class="gk-current">' . get_the_title() . '</span>';
}
// if the page is a home
} else {
Expand Down

0 comments on commit e6447c5

Please sign in to comment.