• Resolved johdburr

    (@johdburr)


    I’d like to change the credits and links in the Harmonic footer. Looking at the footer.php, it seems that this could be done with a filter in a child theme and without copying the whole footer.php file from the parent theme to the child theme.

    Since my knowledge in php coding is very very limited, I would be glad if someone could point me into the right direction…

    Thanks!

    There are four footer files:
    footer.php
    footer-singleportfolio.php
    footer-para.php
    footer-featuredimage.php

    all of theme have a function: do_action ( ‘harmonic_credits’):

    <?php
    /**
     * The template for displaying the footer.
     *
     * Contains the closing of the #content div and all content after
     *
     * @package harmonic
     */
    ?>
    
    					<div class="clear"></div>
    				</div><!-- #content .site-wrapper -->
    			</div><!-- #content-wrapper -->
    			<footer id="colophon" class="site-footer" role="contentinfo">
    
    				<div class="site-info">
    					<?php do_action( 'harmonic_credits' ); ?>
    					<a href="https://www.ads-software.com/" rel="generator"><?php printf( __( 'Proudly powered by %s', 'harmonic' ), 'WordPress' ); ?></a>
    					<span class="sep"> | </span>
    					<?php printf( __( 'Theme: %1$s by %2$s.', 'harmonic' ), 'Harmonic', '<a href="https://wordpress.com/themes/" rel="designer">WordPress.com</a>' ); ?>
    				</div><!-- .site-info -->
    
    			</footer><!-- #colophon .site-footer -->
    		</div><!-- #page -->
    
    		<?php wp_footer(); ?>
    	</body>
    </html>

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Kathryn Presner

    (@zoonini)

    Could you tell me more about exactly how you want to modify the credits?

    all of theme have a function: do_action ( ‘harmonic_credits’):

    Right, but that’s only a small portion of the footer credit – the other part is here:

    <a href="https://www.ads-software.com/" rel="generator"><?php printf( __( 'Proudly powered by %s', 'harmonic' ), 'WordPress' <span class="sep"> | </span>
    <?php printf( __( 'Theme: %1$s by %2$s.', 'harmonic' ), 'Harmonic', '<a href="https://wordpress.com/themes/" rel="designer">WordPress.com</a>' ); ?>

    Knowing exactly how you want to tweak the credit will help me suggest the best method for you.

    Thread Starter johdburr

    (@johdburr)

    Sorry for my late answer! We were cut off from the internet for a while. But now, luckily, back online…

    Well, I’d like to change the footer credits to something similar to this example here: https://test.kreditprojekt.org/:
    a licence text and two links for contact form and imprint.

    In this example I copied the footer.php file from the parent theme to my child theme folder and replaced the WordPress credits with my own text. But here, at Harmonic theme, I wonder if I could hook into that action do_action ( 'harmonic_credits') or if I have to do the same workaround with copying the whole footer.php file and replacing the relevant text. If so, would I have to do this with all four footer files from the Harmonic theme (footer.php, footer-singleportfolio.php, footer-para.php, footer-featuredimage.php) or just with the footer.php only?

    Or is there some other way around?

    Thread Starter johdburr

    (@johdburr)

    Hi Kathryn, any idea on this topic? Please, let me know if you run out of ideas… I am still clueless on how to modify the Harmonic footer with a filter…

    I would appreciate very much your looking over this question. Thanks!

    Moderator Kathryn Presner

    (@zoonini)

    Hi johdburr, I consulted with a colleague, and here’s what they said:

    I don’t think that it’d be possible with a filter… unless they hid everything inside .site-info and then hooked onto the harmonic_credits action and unhid whatever they added with the hook

    Hope that points you in the right direction!

    Thread Starter johdburr

    (@johdburr)

    Thanks a lot for your efforts, Kathryn! I’ll see where and how I can hid, unhid and hook to get there where I want to go. Or I try the workaround from my other blog mentioned above.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘how to change footer links / credits with a filter in a child theme?’ is closed to new replies.