Home › Forums › WoodMart support forum › Footer.php
Footer.php
- This topic has 11 replies, 2 voices, and was last updated 2 years, 8 months ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
June 11, 2022 at 2:05 pm #382552
tekeciParticipantHello. I added the Google Tag Manager codes to footer.php and an error appeared. Then all the footer.php codes were deleted. I think this is a big bug. Can you replace this file?
And there isn’t a page where I can add code inside the head and body tag in the Woodmart theme settings? It has many themes.
Attachments:
You must be logged in to view attached files.June 11, 2022 at 3:09 pm #382558
Aizaz Imtiaz AwanKeymasterHello,
You need to re-install the theme to get the file back.
And the Most Easy way is to add the code to footer or header is by using a free plugin https://wordpress.org/plugins/insert-headers-and-footers/
If you want to edit the header.php file directly then you need to copy the header.php file from the main theme to the child theme and then try adding the code in it.
You can read the following article for further help:
https://www.wpbeginner.com/plugins/how-to-add-header-and-footer-code-in-wordpress/Regards.
Xtemos StudiosJune 11, 2022 at 3:11 pm #382559
tekeciParticipantWhen I re-install the theme, will my changes be deleted?
June 11, 2022 at 3:15 pm #382560
tekeciParticipantI did too many changes on homepage, catalog page and single product page. And added plugin. So I can’t delete them.
June 11, 2022 at 3:18 pm #382561
tekeciParticipantAnd there were few lines of code in footer.php. Why don’t you forward them to me?
June 11, 2022 at 3:34 pm #382562
Aizaz Imtiaz AwanKeymasterHello,
The default code of the footer.php file is bellow:
<?php /** * The template for displaying the footer */ if ( woodmart_get_opt( 'collapse_footer_widgets' ) ) { woodmart_enqueue_js_script( 'footer' ); } $page_id = woodmart_page_ID(); $disable_prefooter = get_post_meta( $page_id, '_woodmart_prefooter_off', true ); $disable_footer_page = get_post_meta( $page_id, '_woodmart_footer_off', true ); $disable_copyrights_page = get_post_meta( $page_id, '_woodmart_copyrights_off', true ); ?> <?php if ( woodmart_needs_footer() ) : ?> <?php if ( ! woodmart_is_woo_ajax() ) : ?> </div><!-- .main-page-wrapper --> <?php endif ?> </div> <!-- end row --> </div> <!-- end container --> <?php if ( ! $disable_prefooter && ( woodmart_get_opt( 'prefooter_area' ) || woodmart_get_opt( 'prefooter_html_block' ) ) ) : ?> <?php woodmart_enqueue_inline_style( 'footer-base' ); ?> <div class="wd-prefooter<?php echo woodmart_get_old_classes( ' woodmart-prefooter' ); ?>"> <div class="container"> <?php if ( 'text' === woodmart_get_opt( 'prefooter_content_type', 'text' ) ) : ?> <?php echo do_shortcode( woodmart_get_opt( 'prefooter_area' ) ); ?> <?php else : ?> <?php echo woodmart_get_html_block( woodmart_get_opt( 'prefooter_html_block' ) ); ?> <?php endif; ?> </div> </div> <?php endif ?> <?php if ( ! function_exists( 'elementor_theme_do_location' ) || ! elementor_theme_do_location( 'footer' ) ) : ?> <footer class="footer-container color-scheme-<?php echo esc_attr( woodmart_get_opt( 'footer-style' ) ); ?>"> <?php if ( ! $disable_footer_page && woodmart_get_opt( 'disable_footer' ) ) : ?> <?php woodmart_enqueue_inline_style( 'footer-base' ); ?> <?php if ( 'widgets' === woodmart_get_opt( 'footer_content_type', 'widgets' ) ) : ?> <?php get_sidebar( 'footer' ); ?> <?php else : ?> <div class="container main-footer"> <?php echo woodmart_get_html_block( woodmart_get_opt( 'footer_html_block' ) ); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ( ! $disable_copyrights_page && woodmart_get_opt( 'disable_copyrights' ) ) : ?> <?php woodmart_enqueue_inline_style( 'footer-base' ); ?> <div class="copyrights-wrapper copyrights-<?php echo esc_attr( woodmart_get_opt( 'copyrights-layout' ) ); ?>"> <div class="container"> <div class="min-footer"> <div class="col-left set-cont-mb-s reset-last-child"> <?php if ( woodmart_get_opt( 'copyrights' ) != '' ) : ?> <?php echo do_shortcode( woodmart_get_opt( 'copyrights' ) ); ?> <?php else : ?> <p>© <?php echo date( 'Y' ); ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a>. <?php esc_html_e( 'All rights reserved', 'woodmart' ); ?></p> <?php endif ?> </div> <?php if ( woodmart_get_opt( 'copyrights2' ) != '' ) : ?> <div class="col-right set-cont-mb-s reset-last-child"> <?php echo do_shortcode( woodmart_get_opt( 'copyrights2' ) ); ?> </div> <?php endif ?> </div> </div> </div> <?php endif ?> </footer> <?php endif ?> <?php endif ?> </div> <!-- end wrapper --> <div class="wd-close-side<?php echo woodmart_get_old_classes( ' woodmart-close-side' ); ?>"></div> <?php do_action( 'woodmart_before_wp_footer' ); ?> <?php wp_footer(); ?> </body> </html>
Best Regards
June 11, 2022 at 3:37 pm #382563
tekeciParticipantI’m getting this error………
Attachments:
You must be logged in to view attached files.June 12, 2022 at 8:40 pm #382651
tekeciParticipantHello again. It’s really important for me. Can you solve this problem?
June 13, 2022 at 9:50 am #382723
Aizaz Imtiaz AwanKeymasterHello,
You need to reinstall the theme in order to fix this issue.
Or you can try uploading only the footer.php file from the theme archive using FTP/Cpanel.
Best Regards
June 13, 2022 at 11:26 am #382750
tekeciParticipantWhen I re-install the theme, will my changes be deleted? I did too many changes on homepage, catalog page and single product page. And added plugin. So I can’t delete them. Can you explain the steps I need to do?
June 13, 2022 at 1:13 pm #382771
tekeciParticipantI solved myself. Thank you.
June 13, 2022 at 2:20 pm #382777
Aizaz Imtiaz AwanKeymasterHello,
We are Glad that your issue has been Resolved.
Let us know if there’s anything else we can do for you! You can always reach us at any time. We are always here to help you.
Have a wonderful day.
Topic Closed.
Best Regards. -
AuthorPosts
The topic ‘Footer.php’ is closed to new replies.
- You must be logged in to create new topics. Login / Register