Developers: How to add additional CSS classes to YARPP's parent <div>

Add the following filter to your theme's functions.php file to add additional CSS classes to every instance of YARPP's parent <div>. This can be useful to customize how YARPP may first appear on a page.

function yarpp_extra_css( $yarpp_classes ) {
  $yarpp_classes[] = 'class_1 class_2';
  $yarpp_classes[] = 'class_3';
  return $yarpp_classes;
add_filter( 'yarpp_parent_css_classes', 'yarpp_extra_css' );

The above code will result in the following:

<div class="yarpp yarpp-related class_1 class_2 class_3">

If you're using the YARPP Block, you can also specify additional CSS classes here:


Was this article helpful?
0 out of 0 found this helpful