this is my functions.php in child
when open it in editor(Microsoft expression web), it higlight the closing tag at the end, like if there is an error
i can’t see an error though
<?php
add_filter('post_class', 'postclass_postspage_columns_correction');
function postclass_postspage_columns_correction( $classes ) {
global $wp_query;
if ( is_home() || is_category() ) $classes[] = 'post-column-'.(($wp_query->current_post%2)?'right':'left');
return $classes;
}
function individual_category_postsperpage( $query ) {
if ( is_admin() || ! $query->is_main_query() )
return;
if ( is_category() ) {
$query->set( 'posts_per_page', 2 );
return;
}
}
add_action( 'pre_get_posts', 'individual_category_postsperpage', 1 );
// Register extra sidebar
function mytheme_widgets_init() {
register_sidebar( array(
'name' => __( 'Extra Sidebar', 'tto' ),
'id' => 'sidebar-4',
'description' => __( 'The Left Sidebar. Displayed on all but full width and homepage template.', 'mytheme' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => "</aside>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'mytheme_widgets_init' );
<?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?>
<div id="extra-sidebar" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-4' ); ?>
</div><!-- .extra-sidebar .widget-area -->
<?php endif; // end extra sidebar widget area ?>
// Override content width (for photo and video embeds)
$content_width = 500;
// Display 1000px width content if full width page template
function mytheme_content_width() {
if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() ) {
global $content_width;
$content_width = 1000;
}
}
add_action( 'template_redirect', 'mytheme_content_width', 11 );
// Change default thumbnail size
function mytheme_twentytwelve_setup() {
set_post_thumbnail_size( 500, 9999 ); // (default featured images)Unlimited height, soft crop
}
add_action( 'after_setup_theme', 'mytheme_twentytwelve_setup', 11 );
// Add child theme body class
function mytheme_body_class( $classes ) {
if( ! is_page_template() )
$classes[] = 'custom-layout';
return $classes;
}
add_filter( 'body_class', 'mytheme_body_class' );
?>