I am using Genesis framework and modern-studio-pro as a child theme. I have just copy this code
function genesis_standard_loop() {
//* Use old loop hook structure if not supporting HTML5
if ( ! genesis_html5() ) {
genesis_legacy_loop();
return;
}
if ( have_posts() ) :
do_action( 'genesis_before_while' );
while ( have_posts() ) : the_post();
do_action( 'genesis_before_entry' );
printf( '<article %s>', genesis_attr( 'entry' ) );
do_action( 'genesis_entry_header' );
do_action( 'genesis_before_entry_content' );
printf( '<div %s>', genesis_attr( 'entry-content' ) );
do_action( 'genesis_entry_content' );
echo '</div>';
do_action( 'genesis_after_entry_content' );
do_action( 'genesis_entry_footer' );
echo '</article>';
do_action( 'genesis_after_entry' );
endwhile; //* end of one post
do_action( 'genesis_after_endwhile' );
else : //* if no posts exist
do_action( 'genesis_loop_else' );
endif; //* end loop
}
from Genesis to child theme functions.php
. After that my site is showing
Fatal error: Cannot redeclare genesis_standard_loop() (previously declared in /home/u282646374/public_html/wp-content/themes/modern-studio-pro/functions.php:198) in /home/u282646374/public_html/wp-content/themes/genesis/lib/structure/loops.php on line 115
I have delete that code from child theme but site not showing. Please tell me how can i regain my site? This is the link of my page http://andrewspalding.co.uk/
Your problem is that you are redeclaring the function genesis_standard_loop()
inside functions.php
of your child theme while on the main genesis theme this function is inside lib/structure/loops.php
child themes will overwrite the parent theme functions if they are inside the same file that they are in the parent theme, if you want to modify a function from the parent theme you might contemplate the idea of looking for filters
or actions
.
If you MUST redeclare the function try recreating the same file structure, but remember to add all of the other functions inside that particular file.