Skip to content

Commit

Permalink
Make title and header always link to the home page.
Browse files Browse the repository at this point in the history
  • Loading branch information
beastaugh committed Dec 16, 2012
1 parent 9645e29 commit 2c19f0e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 27 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Added option to display featured post images in the header.
* Moved language files to `/languages` directory.
* Added POT file to theme files in `languages` directory.
* Title and header always link to the home page.
* Removed uses of call-time pass-by-reference for compatibility with PHP 5.4.
* Replaced use of deprecated `add_custom_image_header` function.
* Stop defining and using header image constants.
Expand Down
45 changes: 19 additions & 26 deletions library/helpers/template_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,25 +310,25 @@ function tarski_headerimage() {
$header_img_url);
}

if (!(get_tarski_option('display_title') || is_front_page()))
$header_img_tag = sprintf(
'<a title="%s" rel="home" href="%s">%s</a>',
__('Return to main page', 'tarski'),
user_trailingslashit(home_url()),
$header_img_tag);
$header_img_tag = sprintf(
'<a title="%s" rel="home" href="%s">%s</a>',
__('Return to main page', 'tarski'),
user_trailingslashit(home_url()),
$header_img_tag);

echo "<div id=\"header-image\">$header_img_tag</div>\n\n";
}

/**
* Returns site title, wrapped in appropriate markup.
*
* The title on the home page will appear inside an h1 element,
* whereas on other pages it will be a link (to the home page),
* wrapped in a p (paragraph) element.
*
* @since 1.5
*
* @uses get_bloginfo
* @uses get_tarski_option
* @uses user_trailingslashit
* @uses home_url
*
* @return string
*
* @hook filter tarski_sitetitle
Expand All @@ -337,21 +337,13 @@ function tarski_headerimage() {
function tarski_sitetitle() {
if (!get_tarski_option('display_title')) return '';

$site_title = get_bloginfo('name');

if (!is_front_page()) {
$site_title = sprintf(
'<a title="%1$s" href="%2$s" rel="home">%3$s</a>',
__('Return to main page','tarski'),
user_trailingslashit(home_url()),
$site_title);
}

if ((get_option('show_on_front') == 'posts') && is_home()) {
$site_title = sprintf('<h1 id="blog-title">%s</h1>', $site_title);
} else {
$site_title = sprintf('<p id="blog-title">%s</p>', $site_title);
}
$site_title = sprintf(
'<h1 id="blog-title">' .
'<a title="%1$s" href="%2$s" rel="home">%3$s</a>' .
'</h1>',
__('Return to main page','tarski'),
user_trailingslashit(home_url()),
get_bloginfo('name'));

return apply_filters('tarski_sitetitle', $site_title);
}
Expand All @@ -368,7 +360,8 @@ function tarski_sitetitle() {
*/
function tarski_tagline() {
$tagline = get_bloginfo('description', 'display');
$tagline = (get_tarski_option('display_tagline') && strlen($tagline)) ? sprintf('<p id="tagline">%s</p>', $tagline) : '';
$tagline = (get_tarski_option('display_tagline') && strlen($tagline))
? sprintf('<p id="tagline">%s</p>', $tagline) : '';
return apply_filters('tarski_tagline', $tagline);
}

Expand Down
2 changes: 1 addition & 1 deletion style.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions style.dev.css
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ body .content li {
line-height: 120%;
}

#blog-title a {
color: #404040;
}

#tagline {
font-family: 'Times New Roman', Times, serif;
font-size: 1.5em;
Expand Down

0 comments on commit 2c19f0e

Please sign in to comment.