I think I need help with the syntax. Is there something missing? I've been using .net for a year so my PHP is rusty. A couple extra eyeballs would be great!
function top-menu isn't showing up after I added
if (is_home())
to the featured widget area.
<?php
//
// Custom Child Theme Functions
//
// Adds a home link to your menu
// http://codex.wordpress.org/Template_Tags/wp_page_menu
function childtheme_menu_args($args) {
$args = array(
'show_home' => 'Home',
'sort_column' => 'menu_order',
'menu_class' => 'menu',
'echo' => true
);
return $args;
}
add_filter('wp_page_menu_args','childtheme_menu_args');
// Register the new menus
function register_my_menus() {
register_nav_menus(
array(
'primary-menu' => __( 'Primary Menu' ),
'top-menu' => __( 'Top Menu' ),
)
);
}
add_action( 'init', 'register_my_menus' );
///Top Menu (optional)
function top_menu() {
if ( has_nav_menu( 'top-menu' ) ) {
wp_nav_menu( array( 'theme_location' => 'top-menu',
'container_id'=>'top-menu',
'container_class' => 'clearfix ',
'menu_class' => 'sf-menu', // we assign the sf-menu class to the menu ul so that superfish works on this menu too
) );
}
}
add_action('thematic_aboveheader','top_menu');
// Add a dynamic menu using wp_list_pages
function childtheme_menu() { ?>
<div class="menu">
<ul class="sf-menu">
<?php wp_list_pages('title_li='); ?>
</ul>
<div id="access-search">
<form id="searchform" method="get" action="<?php bloginfo('home') ?>">
<div>
<input id="s" name="s" type="text" value="Search" onfocus="if (this.value == 'Search InMobi') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search InMobi';}" size="20" tabindex="1" />
<input id="searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Go', 'thematic') ?>" tabindex="2" />
</div>
</form
></div>
</div>
<?php }
add_action('wp_page_menu','childtheme_menu');
// creates widget PHONE NUMBER
function my_widgets_init() {
register_sidebar(array(
'name' => 'Header Phone Number',
'id' => 'header-aside',
'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
'after_widget' => "",
'before_title' => "<h3 class=\"widgettitle\">",
'after_title' => "</h3>\n",
));
}
add_action( 'init', 'my_widgets_init' );
// adding the widget area to your child theme
function my_header_widgets() {
if ( function_exists('dynamic_sidebar') && is_sidebar_active('header-aside') ) {
echo '<div id="header-aside" class="aside clearfix">'. "\n" . '<ul class="xoxo">' . "\n";
dynamic_sidebar('header-aside');
echo '' . "\n" . '</div><!-- #header-aside .aside -->'. "\n";
}
}
add_action('thematic_header', 'my_header_widgets', 8);
// Home Featured
// creates widget Featured Home
function featured_home_widgets_init() {
register_sidebar(array(
'name' => 'Featured Home Page Excerpts',
'id' => 'featured-home',
'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
'after_widget' => "",
'before_title' => "<h3 class=\"widgettitle\">",
'after_title' => "</h3>\n",
));
}
add_action( 'init', 'featured_home_widgets_init' );
// adding the widget area to your child theme
function featured_home_widgets() {
if (is_home()) {
echo get_royalslider(1);
if ( function_exists('dynamic_sidebar') && is_sidebar_active('featured-home') ) {
echo '<div id="featured-home" class="aside clearfix">'. "\n" . '<ul class="xoxo">' . "\n";
dynamic_sidebar('featured-home');
echo '' . "\n" . '</div><!-- #featured-home -->'. "\n";
}
}
}
add_action('thematic_belowheader', 'featured_home_widgets', 8);
// Read More link under Excerpts
function excerpt_read_more_link($output) {
global $post;
return $output . '<a class="btn1" href="'. get_permalink($post->ID) . '"> Read More...</a>';
}
add_filter('the_excerpt', 'excerpt_read_more_link');
// Hide Wordpress version
function wpt_remove_version() {
return '';
}
add_filter('the_generator', 'wpt_remove_version');
// Unleash the power of Thematic's dynamic classes
//
// define('THEMATIC_COMPATIBLE_BODY_CLASS', true);
// define('THEMATIC_COMPATIBLE_POST_CLASS', true);
// Unleash the power of Thematic's comment form
//
// define('THEMATIC_COMPATIBLE_COMMENT_FORM', true);
// Unleash the power of Thematic's feed link functions
//
// define('THEMATIC_COMPATIBLE_FEEDLINKS', true);
?>