WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#22292 closed enhancement (wontfix)

Twenty Twelve: class needed for WordPress credits link

Reported by: bigrob8181 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords:
Focuses: Cc:

Description

In #22095, r22207, r22214:
Removing rel=generator removed the ability to easily hide the "Powered by" link. Before, you could just use css to hide it and now, you would have to add the footer.php to the child theme or edit the parent theme.

It would be awesome if a class could be added to the link to make this easy.

.site-info a.wordpress_footer_link {
    display:none;
}
<footer id="colophon" role="contentinfo">
        <div class="site-info">
                <?php do_action( 'twentytwelve_credits' ); ?>
                        <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentytwelve' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentytwelve' ); ?>" class="wordpress_footer_link"><?php printf( __( 'Proudly powered by %s', 'twentytwelve' ), 'WordPress' ); ?></a>
        </div><!-- .site-info -->
</footer><!-- #colophon -->

Change History (6)

#1 @SergeyBiryukov
7 years ago

Twenty Twelve uses footer[role="contentinfo"] a to set a color for that link:
http://core.trac.wordpress.org/browser/trunk/wp-content/themes/twentytwelve/style.css?rev=22297#L638

Is there any reason not to use the same selector or just .site-info a to hide it in your case?

#2 @DrewAPicture
7 years ago

  • Summary changed from Class needed for wordpress link to Twenty Twelve: Class needed for wordpress link

#3 @bigrob8181
7 years ago

I use the do_action( 'twentytwelve_credits' ) hook in the child theme. If using [role="contentinfo"] or .site-info a, everything within the scope of those will be hidden, styled, or whatever.

Also this is not just limited to twentytwelve as all theme footers are being modified.

#4 follow-up: @SergeyBiryukov
7 years ago

Another option could be .site-info a:last-child, since WordPress link is placed after twentytwelve_credits hook.

#5 in reply to: ↑ 4 @bigrob8181
7 years ago

Replying to SergeyBiryukov:

Another option could be .site-info a:last-child, since WordPress link is placed after twentytwelve_credits hook.

I like it. This will do the trick. Thanks!

#6 @lancewillett
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed
  • Summary changed from Twenty Twelve: Class needed for wordpress link to Twenty Twelve: class needed for WordPress credits link

The last-child technique looks great, closing as wontfix.

Note: See TracTickets for help on using tickets.