Skip to content

Commit

Permalink
Merge pull request #57 from helsingborg-stad/fix/do-not-add-like-for-…
Browse files Browse the repository at this point in the history
…front-page

fix: do not add like for front page
  • Loading branch information
sebastianthulin authored Dec 12, 2024
2 parents 6f99b12 + 6015ce1 commit b74f898
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/php/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ class App
{
private $cacheBust;
private $getOptionFieldsHelper;
private int $frontPageId;

public function __construct(Blade $bladeInstance)
{
$this->frontPageId = (int) get_option('page_on_front', 0);
$this->getOptionFieldsHelper = new GetOptionFields();
new LikeIconCounter($this->getOptionFieldsHelper);

Expand Down Expand Up @@ -69,7 +71,11 @@ public function setModulePostTypes($field)

public function postsIcon($callToActionArray, $post)
{
if (!empty($post->post_type) && in_array($post->post_type, $this->getOptionFieldsHelper->getPostTypes())) {
if (
$this->frontPageId !== $post->ID &&
!empty($post->post_type) &&
in_array($post->post_type, $this->getOptionFieldsHelper->getPostTypes())
) {
$callToActionArray['floating'] = [
'wrapper' => [
'attributeList' => $this->getOptionFieldsHelper->getTooltip() ? [
Expand Down

0 comments on commit b74f898

Please sign in to comment.