php - Only show specific styling if certain theme
one text
Hi i have a wordpress multi-site with different themes.
in classes/class/Theme.php :
PRIVATE CONST SITE1 = 'site1';
PRIVATE CONST SITE2 = 'site2';
PRIVATE CONST SITE3 = 'site3';
public CONST ALLOWED_THEMES = [
self::SITE1,
self::SITE2,
self::SITE3
];
private $theme;
private static Theme $instance;
private function __construct() {
if(function_exists('get_option')) {
$themeOption = get_option(self::CURRENT_THEME_META_KEY);
} else {
$themeOption = false;
}
if($themeOption && in_array($themeOption, self::ALLOWED_THEMES)) {
$this->theme = $themeOption;
} else {
$this->theme = self::SITE1;
}
}
public function getTheme()
{
return $this->theme;
}
I have a Item block that standard has a like/favorite button. I try to exclude this styling if the current theme is site1. But of course I get that self id undefined How would I be able to solve this?
<?php if $this->getTheme() !== self::SITE1 ) : ?>
<div class="post-item__button js-favorite-button" ?>">
<span class="post-item__like icon">
<?= ecs_get_icon_sprite( 'like' ); ?>
</span>
<span class="post-item__like post-item__like--filled icon">
<?= ecs_get_icon_sprite( 'like-filled' ); ?>
</span>
</div>
<?php endif; ?>
I want to exclude this styling from Site1.
Source