functions.php issue in Twentyten Child Theme (3 posts)

  1. Design Locker
    Posted 3 years ago #

    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.

  2. keesiemeijer
    Posted 3 years ago #

    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

  3. Design Locker
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic