Categories
Technology WordPress

Customizing the Privacy Policy link in Genesis eNews Extended

You put together a brand new fancy Privacy Policy page on your WordPress 4.9.6+ site and are ready to include a link to is using the latest version of Genesis eNews Extended. That’s great!

This is a brand new feature, though, so themes aren’t styling for it yet. What can you do?

Styling

Using the Customizer via Apperarance->Customize within WP-Admin, you can add a small bit of “Additional CSS” to change this link’s styling however you’d like. The link is within a small html tag with a class of enews-privacy  with the a tag itself having the WordPress-wide privacy-policy-link class.

In other words, you can target specifically the eNews privacy link with something like:

.enews-privacy a.privacy-policy-link {
color: green;
}

Other CSS selectors, such as the a:focus and so on can be used too.

Changing the text

The text and the link itself is set by WordPress. You can use the the_privacy_policy_link filter (inline docs) to update the entire HTML block or the privacy_policy_url filter (inline docs) to update the overall link or only the URL. Alternative, you can update only the text by using the gettext filter (docs).

For example:

<?php // do not include in an existing php file

// This one works great if this is a secondary site of a company with one central privacy page. Example: Jetpack's site might want the link to always go to automattic.com/privacy/
function bk_change_the_url_only( $url ) {
return 'https://example.com/privacy/';
}

add_filter( 'privacy_policy_url', 'bk_change_the_url_only' );
Advertisements

By <span class='p-author h-card'>Brandon Kraft</span>

My life is an open-source book.

14 replies on “<span class='p-name'>Customizing the Privacy Policy link in Genesis eNews Extended</span>”

Leave a Reply