-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up default permalink structure in functions, nice function for si…
…te logo
- Loading branch information
Michael Allen
committed
Nov 1, 2012
1 parent
a9d96ee
commit 573b7ff
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
//functions (hooks at bottom) | ||
function logo_header () { | ||
$str = '<div class="logo">'; | ||
if (is_front_page()) { | ||
$str .= '<h1>'; | ||
} else { | ||
$str .= '<div>'; | ||
} | ||
$str .= get_bloginfo('title'); | ||
if (is_front_page()) { | ||
$str .= '</h1>'; | ||
} else { | ||
$str .= '</div>'; | ||
} | ||
$str .= '</div>'; | ||
echo $str; | ||
} | ||
|
||
function change_permalinks() { | ||
global $wp_rewrite; | ||
$wp_rewrite->set_permalink_structure('/%category%/%postname%/'); | ||
$wp_rewrite->flush_rules(); | ||
} | ||
|
||
//hooks | ||
add_action('init', 'change_permalinks'); |