• Resolved benwhitehouse

    (@benwhitehouse)


    I’ve searched all over support, found people who seem to have resolved this issue, but when I try on my server, it doesn’t work. I would soooo appreciate some help in simply redeclaring the “twentyten_posted_on” function.

    I thought, because TwentyTen uses conditional calls to functions that I could simply call the function in the child theme and it would override the parent theme’s call. Thus far I get an error saying I cannot redeclare the functions.

    Fatal error: Cannot redeclare twentyten_posted_on() (previously declared in home/upthetree/wp-content/themes/twentyten-utt-v2/functions.php:4) in /home/upthetree/wp-content/themes/twentyten-five/functions.php on line 575

    Any help you guys could provide would be super appreciated!

    Thus far my child’s theme functions.php file is just the redeclaration. What am I missing?

    https://pastebin.com/GpGxE1ay

Viewing 5 replies - 1 through 5 (of 5 total)
  • Michael

    (@alchymyth)

    what is ‘twentyten-five’ and what is the code in its functions.php on line 575 ?
    (actually a few lines before)

    is ‘twentyten-five’ a direct copy of ‘twentyten’ ?

    are these lines in functions.php of ‘twentyten-five’ ?

    if ( ! function_exists( 'twentyten_posted_on' ) ) :
    /**
     * Prints HTML with meta information for the current post-date/time and author.
     *
     * @since Twenty Ten 1.0
     */
    function twentyten_posted_on() {
    .....

    Thread Starter benwhitehouse

    (@benwhitehouse)

    Ooop! Sorry should have specified that. TwentyTen Five is a modification of Twenty Ten to be fully HTML5icised by Smashing Magazine. The functions are, for the most part, untouched except for making it play nice with HTML5.

    https://pastebin.com/0ncwyZ1m

    That’s the complete function file from TwentyTen Five.

    Sorry about that.

    Michael

    (@alchymyth)

    The functions are, for the most part, untouched

    well, they touched this one:

    no conditional there (from line 553 of the pastebin)

    /**
     * Prints HTML with meta information for the current post—date/time and author.
     *
     * @since TwentyTen Five 1.0
     */
    function twentyten_posted_on() {
    ....
    Thread Starter benwhitehouse

    (@benwhitehouse)

    Ahhhh I see! The TwentyTen Five functions.php file has 2 twentyten_posted_on() declarations?! One on line 441 and another on 561.

    That makes no sense right?

    If I delete the last one, it should make my function work. I shall rake them over hot coals!

    Thanks for the help alchymyth!

    Michael

    (@alchymyth)

    well spotted – i didn’t see this.

    can you mark this thread as ‘resolved’ ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cannot Redeclare Functions in Child Theme’ is closed to new replies.