• Hi,

    I am trying to change the footer copyright info in the bottom right… I have managed to do this by changing some info in the parent theme for hestia in the tags.php but I can not make the change in the child theme and make it override the parent. I have tried copying the file structure over and the .php file but this did not work. And when adding the function into my functions.php file it give me a redeclare error.

    What would I be able to add into my functions.php file to override this? Any find and replace or anything? Or a way to override the set function in the parent theme?

    Please let me know if you need the code or more info…

    Thanks

    Harvey

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    I am not familiar with the hestia theme, however in most themes you can change that information right from the footer.php file. Is this not an option with this theme? Let me know if not.

    Best regards, Max

    Thread Starter harveyl12

    (@harveyl12)

    Hi Maxwell,

    Below is the file where the information is pulled from.

    I have tried adding the /inc folder to the child theme and adding the template-tags.php with the changed but this does not make any affect.

    /wp-content/themes/hestia/inc/template-tags.php

    This is the original code here…

    function hesta_bottom_footer_content( $is_callback = false ) {
    	if ( ! $is_callback ) {
    	?>
    		<div class="hestia-bottom-footer-content">
    		<?php
    	}
    	$hestia_general_credits     = get_theme_mod(
    		'hestia_general_credits',
    		sprintf(
    			/* translators: %1$s is Theme Name, %2$s is WordPress */
    			esc_html__( '%1$s | Powered by %2$s', 'hestia' ),
    			sprintf(
    				/* translators: %s is Theme name */
    				'<a href="https://themeisle.com/themes/hestia/" target="_blank" rel="nofollow">%s</a>',
    				esc_html__( 'Hestia', 'hestia' )
    			),
    			/* translators: %s is WordPress */
    			sprintf(
    				'<a href="%1$s" rel="nofollow">%2$s</a>',
    				esc_url( __( 'http://ww.wp.xz.cn', 'hestia' ) ),
    				esc_html__( 'WordPress', 'hestia' )
    			)
    		)
    	);
    	$hestia_copyright_alignment = get_theme_mod( 'hestia_copyright_alignment', 'right' );
    	$menu_class                 = 'pull-left';
    	$copyright_class            = 'pull-right';
    	switch ( $hestia_copyright_alignment ) {
    		case 'left':
    			$menu_class      = 'pull-right';
    			$copyright_class = 'pull-left';
    			break;
    		case 'center':
    			$menu_class      = 'hestia-center';
    			$copyright_class = 'hestia-center';
    	}
    	wp_nav_menu(
    		array(
    			'theme_location' => 'footer',
    			'depth'          => 1,
    			'container'      => 'ul',
    			'menu_class'     => 'footer-menu ' . esc_attr( $menu_class ),
    		)
    	);
    		?>
    	<?php if ( ! empty( $hestia_general_credits ) || is_customize_preview() ) : ?>
    		<div class="copyright <?php echo esc_attr( $copyright_class ); ?>">
    			<?php echo wp_kses_post( $hestia_general_credits ); ?>
    		</div>
    	<?php endif; ?>
    	<?php
    	if ( ! $is_callback ) {
    	?>
    		</div>
    		<?php
    	}
    }

    And this is the same code with the changes i want to make which is the “designed by” part

    function hesta_bottom_footer_content( $is_callback = false ) {
    	if ( ! $is_callback ) {
    	?>
    		<div class="hestia-bottom-footer-content">
    		<?php
    	}
    	$hestia_general_credits     = get_theme_mod(
    		'hestia_general_credits',
    		sprintf(
    			/* translators: %1$s is Theme Name, %2$s is WordPress */
    			esc_html__( 'Designed by HCL Design' ),
    			sprintf(
    				/* translators: %s is Theme name */
    				'<a href="https://themeisle.com/themes/hestia/" target="_blank" rel="nofollow">%s</a>',
    				esc_html__( 'Hestia', 'hestia' )
    			),
    			/* translators: %s is WordPress */
    			sprintf(
    				'<a href="%1$s" rel="nofollow">%2$s</a>',
    				esc_url( __( 'http://ww.wp.xz.cn', 'hestia' ) ),
    				esc_html__( 'WordPress', 'hestia' )
    			)
    		)
    	);
    	$hestia_copyright_alignment = get_theme_mod( 'hestia_copyright_alignment', 'right' );
    	$menu_class                 = 'pull-left';
    	$copyright_class            = 'pull-right';
    	switch ( $hestia_copyright_alignment ) {
    		case 'left':
    			$menu_class      = 'pull-right';
    			$copyright_class = 'pull-left';
    			break;
    		case 'center':
    			$menu_class      = 'hestia-center';
    			$copyright_class = 'hestia-center';
    	}
    	wp_nav_menu(
    		array(
    			'theme_location' => 'footer',
    			'depth'          => 1,
    			'container'      => 'ul',
    			'menu_class'     => 'footer-menu ' . esc_attr( $menu_class ),
    		)
    	);
    		?>
    	<?php if ( ! empty( $hestia_general_credits ) || is_customize_preview() ) : ?>
    		<div class="copyright <?php echo esc_attr( $copyright_class ); ?>">
    			<?php echo wp_kses_post( $hestia_general_credits ); ?>
    		</div>
    	<?php endif; ?>
    	<?php
    	if ( ! $is_callback ) {
    	?>
    		</div>
    		<?php
    	}
    }

    So is there anyway to make this change by adding some sort of function to the functions.php or any other file? Any solution will do that allows me to make this change and it not to change every time the theme updates.

    In the footer.php there is just

    <?php do_action( 'hestia_do_footer' ); ?>

    which is what led me to find the source of this do_action.

    Thanks,

    Harvey

    Hello Harvey, If you make the following edits to that $hestia_general_credits function, I believe you will get the result you are looking for.

    $hestia_general_credits = get_theme_mod(
    ‘hestia_general_credits’,
    sprintf(
    /* translators: %1$s is Theme Name, %2$s is WordPress */
    esc_html__( ‘%1$s |Designed by %2$s’, ‘hestia’),
    sprintf(
    /* translators: %s is Theme name */
    %s‘,
    esc_html__( ‘Hestia’, ‘hestia’ )
    ),
    /* translators: %s is WordPress */
    sprintf(
    %2$s‘,
    esc_url( __( ‘http://ww.wp.xz.cn&#8217;, ‘hestia’ ) ),
    esc_html__( ‘HLC Design’, ‘hestia’ )
    )
    )
    );

    Really, the only changes that should need to be made are changing the word Powered to Designed, and then a few lines down under the sprintf section, switch out WordPress with HLC Design.

    Hope this helps, let me know if not!
    Max

    Thread Starter harveyl12

    (@harveyl12)

    Hi,

    Would you know of a way in which i can add this to a child theme file though so this does not change in a parent theme update?

    This is what i am unable too achieve

    Thanks,

    Harvey

    Thread Starter harveyl12

    (@harveyl12)

    Any ideas will be an help as this is driving me crazy.

    Sorry I didn’t get back to you sooner, which child theme are you using?

    Thanks, Max

    Thread Starter harveyl12

    (@harveyl12)

    a child theme of hestia

    Thread Starter harveyl12

    (@harveyl12)

    Sorry for the late reply, been busy.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Copyright info change’ is closed to new replies.