2

I'm using the ColorMag theme and I wanted to know how to edit the footer. What I've found is that:

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

Is showing the footer and I need to edit customizer.php for that purpose but don't know what to edit as I've seen deleting a single line is resulting drastically so I don't want to risk more by random tries.

  • Have you contacted the ColorMag themes support? – Tom J Nowell May 13 '17 at 12:47
2

At first go to theme directory find inc>functions.php then search for "colormag_footer_copyright" edit this code bellow as you need:

add_action( 'colormag_footer_copyright', 'colormag_footer_copyright', 10 );
/**
 * function to show the footer info, copyright information
 */
if ( ! function_exists( 'colormag_footer_copyright' ) ) :
function colormag_footer_copyright() {
   $site_link = '<a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" ><span>' . get_bloginfo( 'name', 'display' ) . '</span></a>';

   $wp_link = '<a href="https://wordpress.org" target="_blank" title="' . esc_attr__( 'WordPress', 'colormag' ) . '"><span>' . __( 'WordPress', 'colormag' ) . '</span></a>';

   $tg_link =  '<a href="https://themegrill.com/themes/colormag" target="_blank" title="'.esc_attr__( 'ThemeGrill', 'colormag' ).'" rel="designer"><span>'.__( 'ThemeGrill', 'colormag') .'</span></a>';

   $default_footer_value = sprintf( __( 'Copyright &copy; %1$s %2$s. All rights reserved.', 'colormag' ), date( 'Y' ), $site_link ).'<br>'.sprintf( __( 'Theme: %1$s by %2$s.', 'colormag' ), 'ColorMag', $tg_link ).' '.sprintf( __( 'Powered by %s.', 'colormag' ), $wp_link );

   $colormag_footer_copyright = '<div class="copyright">'.$default_footer_value.'</div>';
   echo $colormag_footer_copyright;
}
endif;
| improve this answer | |
2

Login to your WordPress Dashboard.

Go to Appearance => Themes => Editor

Select inc/functions.php from the right side bar.

Search for colormag_footer_copyright and delete the following code.

$wp_link = '<a href="http://wordpress.org" target="_blank" title="' . esc_attr__( 'WordPress', 'colormag' ) . '"><span>' . __( 'WordPress', 'colormag' ) . '</span></a>';

From the below code, delete the code from br tag to end

$default_footer_value = sprintf( __( 'Copyright &copy; %1$s %2$s. All rights reserved.', 'colormag' ), date( 'Y' ), $site_link ).'<br>'.sprintf( __( 'Theme: %1$s by %2$s.', 'colormag' ), 'ColorMag', $tg_link ).' '.sprintf( __( 'Powered by %s.', 'colormag' ), $wp_link );

After deleting the above code which is highlighted in bold, ensure that you have the following code:

$default_footer_value = sprintf( __( 'Copyright &copy; %1$s %2$s. All rights reserved.', 'colormag' ), date( 'Y' ), $site_link );

After deleting the above code which is highlighted in bold, ensure that you have the following code:

$default_footer_value = sprintf( __( 'Copyright &copy; %1$s %2$s. All rights reserved.', 'colormag' ), date( 'Y' ), $site_link );

Source

| improve this answer | |
0

The action colormag_footer_copyright echos a copyright note. if yout want to replace it with your name, you can do it like this:

add_action( 'colormag_footer_copyright', 'my_copyright', 10, 3 );

function my_copyright() {
    echo '&copy; Ishan Mahajan '.date('Y');
}

for example.

if you want to edit the whole footer you can edit the footer.php in your theme folder.

| improve this answer | |
0

Just comment out the theme and wordpress lines. In the inc/function.php file like this:

/*. '<br>' . sprintf( __( 'Theme: %1$s by %2$s.', 'colormag' ), 'ColorMag', $tg_link ) . ' ' . sprintf( __( 'Powered by %s.', 'colormag' ), $wp_link )*/;

FYI For some reason I can only do this in the colormag folder but not the child folder.

Also don't try to delete this line in footer.php

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

It will lose edit bar and other functions in customize.

| improve this answer | |
0

You should never edit theme's files directly because you'll loose it on the next theme update. Here is what I did in my Child Theme functions.php created of ColorMag 1.4.2:

// Function to add my copyright
function child_colormag_footer_copyright() {
    echo '<div class="copyright">© My Copyright '.date('Y').'</div>';
}
// Function hook
add_action( 'colormag_footer_copyright', 'child_colormag_footer_copyright', 11 );

// Function to remove parent function
function child_remove_parent_function() {
    remove_action(  'colormag_footer_copyright', 'colormag_footer_copyright');
}
// Hook removal function
add_action( 'wp_loaded', 'child_remove_parent_function' );
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.