Skip to content

Commit

Permalink
Set up default permalink structure in functions, nice function for si…
Browse files Browse the repository at this point in the history
…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.
27 changes: 27 additions & 0 deletions functions/general.php
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');

0 comments on commit 573b7ff

Please sign in to comment.