| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- function custom_excerpt_length( $length ) {
- return 30;
- }
- /*function yakidoo_theme_setup() {
- }
- add_action( 'after_setup_theme', 'yakidoo_theme_setup' );*/
- add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
- add_theme_support( 'post-thumbnails' ); // enable post thumbnails
- set_post_thumbnail_size( 300, 200, true );
- add_image_size("featured", 263, 250, true);
- add_image_size("featured-wide", 555, 250, true);
- function register_my_menus() {
- register_nav_menus(
- array(
- 'header-menu' => __( 'Header Menu' ),
- 'header-sub-menu' => __( 'Header Sub-menu' )
- )
- );
- }
- add_action( 'init', 'register_my_menus' );
- function yakidoo_widgets_init() {
- register_sidebar( array(
- 'name' => __( 'Main Sidebar', 'theme-slug' ),
- 'id' => 'sidebar-1',
- 'description' => __( 'Widgets in this area will be shown on all posts and pages.', 'theme-slug' ),
- 'before_widget' => '<li id="%1$s" class="widget %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h2 class="widgettitle">',
- 'after_title' => '</h2>',
- ) );
- }
- add_action( 'widgets_init', 'yakidoo_widgets_init' );
- class Yakidoo_Walker extends Walker {
- // Tell Walker where to inherit it's parent and id values
- var $db_fields = array(
- 'parent' => 'menu_item_parent',
- 'id' => 'db_id'
- );
- /**
- * At the start of each element, output a <li> and <a> tag structure.
- *
- * Note: Menu objects include url and title properties, so we will use those.
- */
- function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
- $output .= sprintf( "\n<li itemscope=\"itemscope\" itemtype=\"http://schema.org/SiteNavigationElement\"><a href='%s'%s itemprop=\"url\"><span itemprop=\"name\">%s</span></a></li>\n",
- $item->url,
- ( $item->object_id === get_the_ID() ) ? ' class="current"' : '',
- $item->title
- );
- }
- }
- ?>
|