seanfilidis
Forum Replies Created
-
Forum: Plugins
In reply to: [Autoptimize] Another case of broken CSSFixing the missing bracket in my stylesheet solved all the problems. Is there a particular tool you use to check for syntax errors like that?
Still stumped as to how the problem suddenly manifested.
Thanks
Forum: Fixing WordPress
In reply to: Editing an existing widget.This is my custom sidebar in my child functions.php
<?php function twentythirteenchild_widgets_init() { register_sidebar( array( 'name' => __( 'Third Widget Area', 'twentythirteen' ), 'id' => 'sidebar-3', 'description' => __( 'Is only for the front page.', 'twentythirteen' ), 'before_widget' => '<aside id="%1$s" class="widget widget-fp1">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } add_action( 'widgets_init', 'twentythirteenchild_widgets_init' ); ?>
Wow… I could just us the after_widget attribute. Oh, no that would add it to every widget, I only want to edit that particular one.
Forum: Fixing WordPress
In reply to: Editing an existing widget.I want it in the menu itself (within the generated <aside> tags).
But all that I see in the template is <?php dynamic_sidebar( ‘sidebar-3’ ); ?>. So there is nowhere to insert code.
Forum: Fixing WordPress
In reply to: Fatal Error Cannot RedeclarePresto! Thanks.
My code now looks like this<?php function twentythirteenchild_widgets_init() { register_sidebar( array( 'name' => __( 'Third Widget Area', 'twentythirteen' ), 'id' => 'sidebar-3', 'description' => __( 'Is only for the front page.', 'twentythirteen' ), 'before_widget' => '<aside id="%1$s" class="widget widget-fp1">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } add_action( 'widgets_init', 'twentythirteenchild_widgets_init' ); ?>
Forum: Fixing WordPress
In reply to: Fatal Error Cannot RedeclareFrom what I read, putting that conditional in the beginning should prevent the problem, but it doesn’t seem to be working.
Forum: Fixing WordPress
In reply to: Fatal Error Cannot RedeclareI did. I now realize you can’t do that. The child theme’s functions.php should only contain new functions.
But I have a problem then. I am using the functions.php to create an additional sidebar. I just deleted everything in the functions.php except for this function. But I still get a similar error.
Here is the code in my child theme’s functions.php:
<?php if ( ! function_exists( 'twentythirteen_widgets_init' ) ) { function twentythirteen_widgets_init() { register_sidebar( array( 'name' => __( 'Main Widget Area', 'twentythirteen' ), 'id' => 'sidebar-1', 'description' => __( 'Appears in the footer section of the site.', 'twentythirteen' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => __( 'Secondary Widget Area', 'twentythirteen' ), 'id' => 'sidebar-2', 'description' => __( 'Appears on posts and pages in the sidebar.', 'twentythirteen' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => __( 'Third Widget Area', 'twentythirteen' ), 'id' => 'sidebar-3', 'description' => __( 'Is only for the front page.', 'twentythirteen' ), 'before_widget' => '<aside id="%1$s" class="widget widget-fp1">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } } ?>
As you can see I just added a third sidebar. However I now get this fatal error message:
Fatal error: Cannot redeclare twentythirteen_widgets_init() (previously declared in /home/content/20/11764620/html/wordpress/wp-content/themes/twentythirteen-child/functions.php:7) in /home/content/20/11764620/html/wordpress/wp-content/themes/twentythirteen/functions.php on line 245