Skip to content

Instantly share code, notes, and snippets.

@sybrew
Created March 20, 2024 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sybrew/642fa3ad0c715ac5e1d5c9ee0d63fbfb to your computer and use it in GitHub Desktop.
Save sybrew/642fa3ad0c715ac5e1d5c9ee0d63fbfb to your computer and use it in GitHub Desktop.
Styles the breadcrumb separator in TSF, by decreasing the separator distances from 1ch to 0.5ch.
<?php
// Don't include the PHP opening tag if PHP is already open.
// From: https://wordpress.org/support/topic/format-space-around-separator-in-breadcrumb/
add_filter(
'the_seo_framework_breadcrumb_shortcode_css',
function ( $css, $class ) {
// Create a reference so we do not have to write the long selector repeatedly.
$sep_css = &$css[ "nav.$class ol li:not(:last-child)::after" ];
$sep_css[] = 'margin-inline-end:.5ch';
$sep_css[] = 'margin-inline-start:.5ch';
return $css;
},
10,
2,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment