简体   繁体   English

删除或编辑有关儿童主题的页脚积分(wordpress)

[英]Remove or edit Footer credits on child theme (wordpress)

I am working on a child theme based on a free wordpress theme. 我正在基于免费的wordpress主题开发儿童主题。 On the original theme, at the bottom, two credit lines are shown. 在原始主题的底部,显示了两个信用额度。 I want to edit or remove these lines but have not been able to. 我想编辑或删除这些行,但无法执行。 I tried at first to write on the style.css file .site-info { display:none; 我最初尝试在style.css文件.site-info {display:none; } , but it did't work out. },但没有成功。 I then went to the footer.php files and copied them on my child theme. 然后,我转到footer.php文件,并将其复制到我的子主题中。 The original theme has two footer.php files, one of them in a folder called inc-->structure-->footer.php I played around with both files but nothing seemed to work. 原始主题有两个footer.php文件,其中一个在名为inc-> structure-> footer.php的文件夹中,我使用了这两个文件,但似乎无济于事。 On the second footer.php file I tried to erase completely the if ( ! function_exists( 'kiyoshi_credit' ) ) function but my webpage still shows the credit line. 在第二个footer.php文件中,我尝试完全擦除if(!function_exists('kiyoshi_credit'))函数,但是我的网页上仍然显示信用额度。 It seems like it is still grabbing it from the original theme and not my child theme. 似乎它仍然是从原始主题而不是我的孩子主题中获取的。 Any ideas? 有任何想法吗? I show you all the code on my theme, hopefully you can help me out. 我向您展示了有关该主题的所有代码,希望您能对我有所帮助。

The first footer.php file looks something like this: 第一个footer.php文件如下所示:

<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the #content div and all content after.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package kiyoshi
*/

?>

</div><!-- #content -->

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

<footer id="colophon" class="site-footer" role="contentinfo">

    <?php
    /**
     * @hooked kiyoshi_footer_branding - 10
     * @hooked kiyoshi_footer_widgets - 20
     * @hooked kiyoshi_credit - 30
     */
    do_action( 'kiyoshi_footer' ); ?>

</footer><!-- #colophon -->

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

The second footer.php file, in the inc-->structure folder looks something like this: inc-> structure文件夹中的第二个footer.php文件如下所示:

<?php
/**
* Template functions used for the site footer.
*
* @package kiyoshi
*/

if ( ! function_exists( 'kiyoshi_footer_branding' ) ) {
/**
 * Display the branding in footer
 * @since  1.0.0     
 */
 function kiyoshi_footer_branding() {
    ?>
    <div class="footer-branding">
        <h3 class="site-title--footer"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h3>
        <?php if ( '' != get_bloginfo( 'description' ) ) { ?>
            <p class="site-description--footer"><?php bloginfo('description' ); ?></p>
        <?php } ?>      
    </div><!-- .footer-branding -->
    <?php
}
}

if ( ! function_exists( 'kiyoshi_footer_widgets' ) ) {
/**
 * Display widgets in footer
 * @since  1.0.0     
 */
function kiyoshi_footer_widgets() {
    ?>      
    <div class="footer-widgets">
        <?php if ( is_active_sidebar( 'footer-1' ) ) { ?>     
        <?php   dynamic_sidebar( 'footer-1' ); ?>
      <?php } ?>
    </div><!-- .footer-widgets -->
    <?php
}
}

  if ( ! function_exists( 'kiyoshi_credit' ) ) {
 /**
 * Display the theme credit
 * @since  1.0.0     
 */
function kiyoshi_credit() {
    ?>      
    <div class="site-info">
        <?php printf( esc_html__( 'Proudly powered by %s', 'kiyoshi' ), '<a href="https://wordpress.org/">WordPress</a>' ); ?><br />
        <?php printf( esc_html__( 'Theme %1$s by %2$s', 'kiyoshi' ), 'Kiyoshi', '<a href="http://felixdorner.de" rel="designer">Felix Dorner</a>' ); ?>
    </div><!-- .site-info -->
    <?php
}
}

This is the Footer section on my style.css: 这是我的style.css中的页脚部分:

/* Footer */
.site-footer {
float: left;
display: block;
margin-right: 2.85714%;
width: 100%;
margin-right: 0;
padding: 60px 0 90px;
border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.site-info {
  display: none;
}
.site-footer:last-child {
  margin-right: 0;
}
.site-footer .footer-branding {
  float: left;
  display: block;
  margin-right: 2.85714%;
  width: 100%;
}
.site-footer .footer-branding:last-child {
  margin-right: 0;
}
.site-footer .footer-widgets {
  float: left;
  display: block;
  margin-right: 2.85714%;
  width: 100%;
  margin-right: 0;
}
.site-footer .footer-widgets:last-child {
  margin-right: 0;
}
.site-footer .footer-widgets .widget {
  float: left;
  display: block;
  margin-right: 2.85714%;
  width: 100%;
  margin-bottom: 30px;
}
.site-footer .footer-widgets .widget:last-child {
  margin-right: 0;
}
.site-footer .footer-widgets .widget ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}
@media screen and (min-width: 40em) {
  .site-footer .footer-branding {
    float: left;
    display: block;
    margin-right: 2.85714%;
    width: 31.42857%;
  }
  .site-footer .footer-branding:last-child {
    margin-right: 0;
  }
  .site-footer .footer-widgets {
    float: left;
    display: block;
    margin-right: 2.85714%;
    width: 65.71429%;
    margin-right: 0;
  }
  .site-footer .footer-widgets:last-child {
    margin-right: 0;
  }
  .site-footer .footer-widgets .widget {
    float: left;
    display: block;
    margin-right: 4.34783%;
    width: 47.82609%;
  }
  .site-footer .footer-widgets .widget:last-child {
    margin-right: 0;
  }
  .site-footer .footer-widgets .widget:nth-child(2n) {
    margin-right: 0;
  }
  .site-footer .footer-widgets .widget:nth-child(2n+1) {
    clear: left;
  }
}
@media screen and (min-width: 60em) {
.site-footer .footer-branding {
float: left;
display: block;
margin-right: 2.85714%;
width: 22.85714%;
  }
  .site-footer .footer-branding:last-child {
    margin-right: 0;
  }
  .site-footer .footer-widgets {
float: left;
display: block;
margin-right: 2.85714%;
width: 74.28571%;
margin-right: 0;
  }
  .site-footer .footer-widgets:last-child {
margin-right: 0;
  }
  .site-footer .footer-widgets .widget {
float: left;
display: block;
margin-right: 3.84615%;
width: 30.76923%;
  }
  .site-footer .footer-widgets .widget:last-child {
margin-right: 0;
  }
  .site-footer .footer-widgets .widget:nth-child(2n) {
margin-right: 2.85714%;
  }
  .site-footer .footer-widgets .widget:nth-child(2n+1) {
clear: none;
  }
  .site-footer .footer-widgets .widget:nth-child(3n) {
margin-right: 0;
  }
  .site-footer .footer-widgets .widget:nth-child(3n+1) {
clear: left;
  }
}
.site-footer {
  float: left;
  display: block;
  margin-right: 2.85714%;
  width: 100%;
  text-align: center;
  margin-top: 30px;
  opacity: .4;
}

尝试在您的子functions.php文件中使用此代码

remove_action( 'kiyoshi_footer', 'kiyoshi_credit', 30);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM