Hi there,
you would need to use a Child Theme, so you can create your own content-single.php template.
Copy the original template from here:
https://github.com/tomusborne/generatepress/blob/master/content-single.php
And this line is what you need to change:
<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
For example you could add your own filter hook to it like so:
<div class="entry-content"<?php echo apply_filters('my_custom_filter', $data ); echo $itemprop; /* phpcs:ignore -- No escaping needed. */?>>
And the in your functions you can use the filter like so:
add_filter('my_custom_filter', function($data) {
if ( is_user_logged_in() && in_array( 'subcriber', (array) $user->roles ) ) {
// do something for logged in subscribers
$data = 'data-o-authenticated';
} else {
// do something for others
$data = 'data-o-anonymous';
}
return $data;
});
You will need to check what template tags you require in your IF conditions for determining the user logged in role.