2017-10-11 2 views
0

Ich arbeite an einem Kind Thema basierend auf einem kostenlosen Wordpress Theme. Auf dem ursprünglichen Thema werden unten zwei Kreditlinien angezeigt. Ich möchte diese Zeilen bearbeiten oder entfernen, habe es aber nicht geschafft. Ich habe zuerst versucht auf die style.css Datei zu schreiben .site-info {display: none; }, aber es hat nicht geklappt. Ich bin dann zu den footer.php Dateien gegangen und habe sie auf mein Child Theme kopiert. Das ursprüngliche Thema hat zwei footer.php Dateien, eine davon in einem Ordner namens inc -> structure -> footer.php Ich spielte mit beiden Dateien herum, aber nichts schien zu funktionieren. In der zweiten footer.php-Datei habe ich versucht, die Funktion if (! Function_exists ('kiyoshi_credit')) komplett zu löschen, aber meine Webseite zeigt immer noch die Kreditlinie. Es scheint, als ob es immer noch vom ursprünglichen Thema und nicht von meinem Kind Thema greift. Irgendwelche Ideen? Ich zeige dir den ganzen Code zu meinem Thema, hoffentlich kannst du mir helfen. > Ordnerstruktur sieht etwas -Entfernen oder bearbeiten Footer Credits auf Kind Thema (WordPress)

<?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'); ?> 

Die zweite footer.php Datei, in der inc:

Die erste footer.php Datei etwa wie folgt aussieht wie folgt:

<?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 
} 
} 
Dieser

ist der Footer Abschnitt auf meiner 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; 
} 

Antwort

1

Versuchen Sie diesen Code in Ihrem Kind functions.php-Datei zu verwenden

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

Dank, es ist ein Cache-Problem auf Chrom war. Man muss Caches fast jeden Klick löschen. –

Verwandte Themen