Tagged: footer
- This topic has 3 replies, 2 voices, and was last updated 8 years, 3 months ago by Mahesh.
-
AuthorPosts
-
August 5, 2016 at 11:32 am #96634WombattleParticipant
I am trying to add a link in the footer of Catch Flames. I created the child theme following your instruction in another thread and added some code to functions.php you provided based on similar requests for Catch Responsive and Catch Box. Sadly didn’t work, but I’m definitely no programmer. I only need to add one link. Could you please help? Here is one of my attempts
function catchflames_child_footer_content() { //catchflames_flush_transients(); if ( ( !$catchflames_footer_content = get_transient( 'catchflames_footer_content' ) ) ) { echo '<!-- refreshing cache -->'; $catchflames_content = catchflames_(); $catchflames_footer_content = ' <div id="site-generator"> <div class="wrapper"> <div id="custom-links"> <a title="Data Link" href="#" target="_self">Data Link</a> | <a title="Cookie Link" href="#" target="_self">Cookie Link</a> | <a title="Security Link" href="#" target="_self">Security Link</a> </div> <div id="footer-content" class="copyright">' . $catchflames_content['left'] . ' | ' . $catchflames_content['right'] . '</div> </div><!-- .wrapper --> </div><!-- #site-generator -->'; set_transient( 'catchflames_footer_content', $catchflames_footer_content, 86940 ); } echo $catchflames_footer_content; } add_action( 'init', 'catchflames_child_add_links_in_footer' ); function catchflames_child_add_links_in_footer() { remove_action( 'catchflames_footer', 'catchflames_footer_content', 100 ); add_action( 'catchflames_footer', 'catchflames_child_footer_content', 100 ); }
August 5, 2016 at 4:11 pm #96655MaheshParticipant@wombattle: The above code is for Catch Responsive and won’t work on Catch Flames. Its a bit tricky for Catch Flames. Add the following code in you child theme’s
functions.php
function catchflames_child_assets(){ $custom_link = ' | <a href="somelink.com" title="some_link_title">Some Link Text</a>'; $catchflames_content = ' <div class="copyright">'. esc_attr__( 'Copyright', 'catch-flames' ) . ' © '. catchflames_the_year() . ' ' . catchflames_site_link() . ' ' . esc_attr__( 'All Rights Reserved', 'catch-flames' ) . $custom_link .' </div> <div class="powered">'. catchflames_theme_name() . catchflames_theme_author() . ' </div>'; return $catchflames_content; } function catchflames_child_footer_content() { delete_transient( 'catchflames_footer_content' ); if ( ( !$catchflames_footer_content = get_transient( 'catchflames_footer_content' ) ) ) { echo '<!-- refreshing cache -->'; $catchflames_footer_content = catchflames_child_assets(); set_transient( 'catchflames_footer_content', $catchflames_footer_content, 86940 ); } echo $catchflames_footer_content; } function catchflames_child_custom_footer(){ remove_action( 'catchflames_site_generator', 'catchflames_footer_content', 30 ); add_action( 'catchflames_site_generator', 'catchflames_child_footer_content', 30 ); } add_action( 'init', 'catchflames_child_custom_footer' );
If you aren’t familiar with coding, I recommend you to upgrade to Pro since this option is available by default. Or hire a customizer.
Regards,
MaheshAugust 5, 2016 at 4:50 pm #96656WombattleParticipant@mahesh: Brilliant! That code works a treat. I really appreciate the assistance and advice. Thank you for the quick response.
August 8, 2016 at 9:30 am #96762MaheshParticipant@wombattle: Thank you for your appreciation. If you like my support and Catch Flames theme then please support by providing your valuable review and rating at https://wordpress.org/support/view/theme-reviews/catch-flames?rate=5#postform.
Have a nice day!Regards,
Mahesh -
AuthorPosts
- The topic ‘Link in Footer’ is closed to new replies.