Home › Forums › Free Themes › WEN Associate › Link in "wen associate" footer
- This topic has 5 replies, 2 voices, and was last updated 9 years ago by wensolutions.
-
AuthorPosts
-
December 5, 2015 at 11:58 am #469arkyannellParticipant
Hi,
how can I insert a link in the footer? I’ve tried adding “Privacy policy“, but it doesn’t work.
Thank you for your attention.
Best regards.
DanDecember 5, 2015 at 10:14 pm #470wensolutionsKeymasterHello Dan,
This can be easily achieve by making a Child theme from your current parent theme. You can learn how to make a Child Theme.
So now entire section of footer can just be edit by copying this function
wen_associate_footer_copyright
frominc/hook/core.php
file and paste this entire function in your child theme’s functions.php which would look like this.function wen_associate_footer_copyright(){ // Just add or edit snippets to modify the things inside it }
Let us know if it didn’t work or have problem modifying it.
Thank you.
December 6, 2015 at 3:52 pm #472arkyannellParticipantI didn’t understand the exact part I have to copy and past from the file core.php of the father theme to the file functions.php of my child theme.
I see in core.php the following code:if( ! function_exists( 'wen_associate_footer_copyright' ) ) : /** * Footer copyright * * @since WEN Associate 1.0 */ function wen_associate_footer_copyright(){ // Check if footer is disabled $footer_status = apply_filters( 'wen_associate_filter_footer_status', true ); if ( true !== $footer_status) { return; } // Copyright $copyright_text = wen_associate_get_option( 'copyright_text' ); $copyright_text = apply_filters( 'wen_associate_filter_copyright_text', $copyright_text ); // Footer navigation $footer_menu_content = wp_nav_menu( array( 'theme_location' => 'footer' , 'container' => 'div' , 'container_id' => 'footer-navigation' , 'depth' => 1 , 'fallback_cb' => false , 'echo' => false , ) ); ?> <div class="row"> <?php if ( ! empty( $footer_menu_content ) || ! empty( $copyright_text ) ): ?> <div class="col-sm-6"> <?php if ( ! empty( $footer_menu_content ) ): ?> <?php echo $footer_menu_content; ?> <?php endif ?> <?php if ( ! empty( $copyright_text ) ): ?> <div class="copyright"> <?php echo esc_html( $copyright_text ); ?> </div><!-- .copyright --> <?php endif ?> </div><!-- .col-sm-6 --> <?php endif ?> <div class="col-sm-6 pull-right"> <div class="site-info"> <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'wen-associate' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'wen-associate' ), 'WordPress' ); ?></a> <span class="sep"> | </span> <?php printf( __( 'Theme: %1$s by %2$s.', 'wen-associate' ), 'WEN Associate', '<a href="http://wenthemes.com/" rel="designer" target="_blank">WEN Themes</a>' ); ?> </div><!-- .site-info --> </div><!-- .col-sm-6 --> </div><!-- .row --> <?php } endif; add_action( 'wen_associate_action_footer', 'wen_associate_footer_copyright', 10 ); if( ! function_exists( 'wen_associate_footer_goto_top' ) ) : /** * Go to top * * @since WEN Associate 1.0 */ function wen_associate_footer_goto_top(){ $go_to_top = wen_associate_get_option( 'go_to_top' ); if ( 1 != $go_to_top ) { return; } echo '<a href="#" class="scrollup" id="btn-scrollup"><i class="fa fa-chevron-circle-up"></i></a>'; } endif;
Is it right? Have I to copy ALL the code and modify…what?
Could you write me the functions.php code to insert the link in footer?
Thank you so much.
DanDecember 6, 2015 at 8:15 pm #473wensolutionsKeymasterHello Dan,
Assuming that you have set up your Child theme and you are wishing to put your ‘Privacy Policy’ link just next to your footer copyright text. Well now just copy and paste the following lines of code in your Child Theme’s functions.php .
<?php /** * Footer copyright * * @since WEN Associate 1.0 */ function wen_associate_footer_copyright(){ // Check if footer is disabled $footer_status = apply_filters( 'wen_associate_filter_footer_status', true ); if ( true !== $footer_status) { return; } // Copyright $copyright_text = wen_associate_get_option( 'copyright_text' ); $copyright_text = apply_filters( 'wen_associate_filter_copyright_text', $copyright_text ); // Footer navigation $footer_menu_content = wp_nav_menu( array( 'theme_location' => 'footer' , 'container' => 'div' , 'container_id' => 'footer-navigation' , 'depth' => 1 , 'fallback_cb' => false , 'echo' => false , ) ); ?> <div class="row"> <?php if ( ! empty( $footer_menu_content ) || ! empty( $copyright_text ) ): ?> <div class="col-sm-6"> <?php if ( ! empty( $footer_menu_content ) ): ?> <?php echo $footer_menu_content; ?> <?php endif ?> <?php if ( ! empty( $copyright_text ) ): ?> <div class="copyright"> <?php echo esc_html( $copyright_text ); ?> <a href="http://www.sitename.ext/privacy-policy-page">Privacy policy</a> </div><!-- .copyright --> <?php endif ?> </div><!-- .col-sm-6 --> <?php endif ?> <div class="col-sm-6 pull-right"> <div class="site-info"> <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'wen-associate' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'wen-associate' ), 'WordPress' ); ?></a> <span class="sep"> | </span> <?php printf( __( 'Theme: %1$s by %2$s.', 'wen-associate' ), 'WEN Associate', '<a href="http://wenthemes.com/" rel="designer" target="_blank">WEN Themes</a>' ); ?> </div><!-- .site-info --> </div><!-- .col-sm-6 --> </div><!-- .row --> <?php }
Note:
Please check for PHP opening tag in the beginning ( may not require if its already there) if it gives error in your case. Otherwise it should work fine.Thank you
December 7, 2015 at 2:00 am #482arkyannellParticipantHi, thank you so much! It works! 🙂
Sincerely yours,
DanDecember 7, 2015 at 10:03 am #483wensolutionsKeymasterNo problem, Dan. Feel free to post your queries anytime in our forum.
Thanks
-
AuthorPosts
- You must be logged in to reply to this topic.