';
}
$items = $homelink . $items;
return $items;
}
add_filter('wp_list_pages', 'butterbelly_nav_menu_items');
/* ----------------------------------------------------------------------------------- */
/* Breadcrumbs Plugin
/*----------------------------------------------------------------------------------- */
function butterbelly_breadcrumbs() {
$delimiter = '»';
$home = 'Home'; // text for the 'Home' link
$before = ''; // tag before the current crumb
$after = ''; // tag after the current crumb
echo '
\n";
}
}
//For Attachment Page
/**
* Prints HTML with meta information for the current post (category, tags and permalink).
*
*/
function butterbelly_posted_in() {
// Retrieves tag list of current post, separated by commas.
$tag_list = get_the_tag_list('', ', ');
if ($tag_list) {
$posted_in = THIS_ENTRY_WAS_POSTED_IN . ' .' . AND_TAGGED . ' %2$s.' . BOOKMARK_THE . ' ' . PERMALINK . '.';
} elseif (is_object_in_taxonomy(get_post_type(), 'category')) {
$posted_in = THIS_ENTRY_WAS_POSTED_IN . ' %1$s. ' . BOOKMARK_THE . ' ' . PERMALINK . '.';
} else {
$posted_in = BOOKMARK_THE . '' . PERMALINK . '.';
}
// Prints the string, replacing the placeholders.
printf(
$posted_in, get_the_category_list(', '), $tag_list, get_permalink(), the_title_attribute('echo=0')
);
}
/**
* Set the content width based on the theme's design and stylesheet.
*
* Used to set the width of images and content. Should be equal to the width the theme
* is designed for, generally via the style.css stylesheet.
*/
if (!isset($content_width))
$content_width = 590;
/**
* Register widgetized areas, including two sidebars and four widget-ready columns in the footer.
*
* To override twentyten_widgets_init() in a child theme, remove the action hook and add your own
* function tied to the init hook.
*
* @uses register_sidebar
*/
function butterbelly_widgets_init() {
// Area 1, located at the top of the sidebar.
register_sidebar(array(
'name' => PRIMARY_WIDGET,
'id' => 'primary-widget-area',
'description' => THE_PRIMARY_WIDGET,
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
// Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
register_sidebar(array(
'name' => SECONDRY_WIDGET,
'id' => 'secondary-widget-area',
'description' => THE_SECONDRY_WIDGET,
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
// Area 3, located in the footer. Empty by default.
register_sidebar(array(
'name' => FIRST_FOOTER_WIDGET,
'id' => 'first-footer-widget-area',
'description' => THE_FIRST_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
// Area 4, located in the footer. Empty by default.
register_sidebar(array(
'name' => SECONDRY_FOOTER_WIDGET,
'id' => 'second-footer-widget-area',
'description' => THE_SECONDRY_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
// Area 5, located in the footer. Empty by default.
register_sidebar(array(
'name' => THIRD_FOOTER_WIDGET,
'id' => 'third-footer-widget-area',
'description' => THE_THIRD_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
// Area 6, located in the footer. Empty by default.
register_sidebar(array(
'name' => FOURTH_FOOTER_WIDGET,
'id' => 'fourth-footer-widget-area',
'description' => THE_FOURTH_FOOTER_WIDGET,
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
}
/** Register sidebars by running butterbelly_widgets_init() on the widgets_init hook. */
add_action('widgets_init', 'butterbelly_widgets_init');
/////////Theme Options
/* ----------------------------------------------------------------------------------- */
/* Add Favicon
/*----------------------------------------------------------------------------------- */
function butterbelly_childtheme_favicon() {
if (butterbelly_get_option('butterbelly_favicon') != '') {
echo '' . "\n";
}
}
add_action('wp_head', 'butterbelly_childtheme_favicon');
/* ----------------------------------------------------------------------------------- */
/* Custom CSS Styles */
/* ----------------------------------------------------------------------------------- */
function butterbelly_of_head_css() {
$output = '';
$custom_css = butterbelly_get_option('butterbelly_customcss');
if ($custom_css <> '') {
$output .= $custom_css . "\n";
}
// Output styles
if ($output <> '') {
$output = "\n\n";
echo $output;
}
}
add_action('wp_head', 'butterbelly_of_head_css');
function get_category_id($cat_name) {
$term = get_term_by('name', $cat_name, 'category');
return $term->term_id;
}
/**
* Shows posts custom image thumbnails
* @global type $post
* @global type $posts
*/
function butterbelly_main_image() {
global $post, $posts;
//This is required to set to Null
$id = '';
$the_title = '';
// Till Here
$permalink = get_permalink($id);
$homeLink = get_template_directory_uri();
$first_img = '';
$output = preg_match_all('//i', $post->post_content, $matches);
if (isset($matches [1] [0])) {
$first_img = $matches [1] [0];
}
if (empty($first_img)) { //Defines a default image
} else {
print "";
}
}
/**
* Filters wp_title to print a neat tag based on what is being viewed.
*/
function butterbelly_wp_title($title, $sep) {
global $page, $paged;
if (is_feed())
return $title;
// Add the blog name
$title .= get_bloginfo('name');
// Add the blog description for the home/front page.
$site_description = get_bloginfo('description', 'display');
if ($site_description && ( is_home() || is_front_page() ))
$title .= " $sep $site_description";
// Add a page number if necessary:
if ($paged >= 2 || $page >= 2)
$title .= " $sep " . sprintf(__('Page %s', 'butterbelly'), max($paged, $page));
return $title;
}
add_filter('wp_title', 'butterbelly_wp_title', 10, 2);
?>