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

Comments

2 responses to “Customizing the Privacy Policy link in Genesis eNews Extended

  1. A Guy Called Kraft 🏅 Avatar

    On mobile, I can’t open that group but I’ll join it something soon. I answered a decent thread on w.org about GDPR, if there is anything there that helps. Might write a post too.

  2. Susan Ramsey Avatar

    Thanks, Brandon. I just shared your post with the #GenesisWP Facebook group, as there have been a number of questions in the group about the plugin: facebook.com/groups/genesis…

Leave a Reply