WordPress.org

Support

Support » How-To and Troubleshooting » functions.php issue in Twentyten Child Theme

functions.php issue in Twentyten Child Theme

  • Hello All,

    I am using a twentyten child theme.

    I have a file called functions.php in my child theme folder and all it contains is the following;

    function twentyten_continue_reading_link() {
    	return ' <a href="'. get_permalink() . '">' . __( '<div class="moreinfo">More Information <span class="meta-nav">&raquo;</span></div>', 'twentyten' ) . '</a>';
    }

    I use the above code as I want to change the wording “continue reading” to “more information”.

    No here’s the strange thing. Sometimes (but not all the time), the site crashes with the following error;

    “Cannot redeclare twentyten_continue_reading_link()”

    I just re-upload my functions file and it works again even though it is the exact same file with the exact same code.

    I read somewhere that my child theme’s functions should have a unique prefix? Unfortunately I do not understand this.

    Any suggestions would be very welcome.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator keesiemeijer

    @keesiemeijer

    I think that is because the function in the parent theme doesn’t check if it allready exists (in the child theme):

    if ( !function_exists( 'twentyten_continue_reading_link' ) ) {
    function twentyten_continue_reading_link() {...}
    }

    Look here how you can alter the continue reading link from your child theme: http://wordpress.org/support/topic/custom-continue-reading-in-twentyten

    Hi keesiemeijer,

    Thanks for the reply.

    I created the custom field “cont_read” I treid the code suggested by alchymyth in the link above but unfortunately did not work for me.

    The excerpt area just goes blank apart from the image and title.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘functions.php issue in Twentyten Child Theme’ is closed to new replies.
Skip to toolbar