Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #96634
    Wombattle
    Participant

    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 );
    }
    #96655
    Mahesh
    Participant

    @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' ) . ' &copy; '. 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,
    Mahesh

    #96656
    Wombattle
    Participant

    @mahesh: Brilliant! That code works a treat. I really appreciate the assistance and advice. Thank you for the quick response.

    #96762
    Mahesh
    Participant

    @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

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Link in Footer’ is closed to new replies.