*

Own Petz

  • ****
  • 126 posts
  • OwnPetz - Free Classified Ads. Buy, Sell or Adopt
More than one h1 tag Error on Product Page Delta Theme
« on: March 14, 2024, 06:47:08 AM »
Hello,

More than one h1 tag error on each product page in delta theme. (screenshot attached)

actually when I checked page source of product  -

One is -

<div class="basic isDesktop isTablet"> <h1> <div class="price mbCl3 p-23999000000x">23999.00 Rs.</div> Nothing Phone (2a) 5G Phone with Dual 50 MP Rear Camera </h1>

and other is

<div class="basic isMobile"> <h1> <div class="price mbCl3 p-23999000000x">23999.00 Rs.</div> Nothing Phone (2a) 5G Phone with Dual 50 MP Rear Camera </h1>


Can you please tell me how to fix this issue.

Thanks in Advance.
« Last Edit: March 15, 2024, 02:59:17 AM by Own Petz »
OwnPetz - Free Classified Ads. Buy, Sell or Adopt Online. https://ownpetz.com

*

Own Petz

  • ****
  • 126 posts
  • OwnPetz - Free Classified Ads. Buy, Sell or Adopt
Re: More than one h1 tag Error on Product Page
« Reply #1 on: March 14, 2024, 09:33:47 AM »
I find some solution , to fix this issue.. but I am not sure its right and if its right then how to do this in css


use CSS to hide one of the headings based on the screen size:

@media (max-width: 768px) { /* Adjust the screen size as needed */
    .desktop-heading {
        display: none;
    }
}

@media (min-width: 769px) { /* Adjust the screen size as needed */
    .mobile-heading {
        display: none;
    }
}
OwnPetz - Free Classified Ads. Buy, Sell or Adopt Online. https://ownpetz.com

*

Own Petz

  • ****
  • 126 posts
  • OwnPetz - Free Classified Ads. Buy, Sell or Adopt
Re: More than one h1 tag Error on Product Page
« Reply #2 on: March 14, 2024, 07:14:44 PM »
Waiting for reply.  Can anyone please suggest me how to fix this.. as you know for best seo only one h1 tag is required on page.
OwnPetz - Free Classified Ads. Buy, Sell or Adopt Online. https://ownpetz.com

*

Own Petz

  • ****
  • 126 posts
  • OwnPetz - Free Classified Ads. Buy, Sell or Adopt
Re: More than one h1 tag Error on Product Page Delta Theme
« Reply #3 on: March 15, 2024, 09:21:08 AM »
Hello,

I found this code in item.php

For Desktop

<div class="basic isDesktop isTablet">
<h1>
<?php if(del_check_category_price(osc_item_category_id())) { ?>
<div class="price mbCl3 p-<?php echo osc_item_price(); ?>x<?php if(osc_item_price() <= 0) { ?> isstring<?php } ?>"><?php echo osc_item_formated_price(); ?></div>
<?php } ?>

<?php echo osc_item_title(); ?>
</h1>



<?php if($make_offer_enabled) { ?>
<a href="#" id="mk-offer" class="make-offer-link" data-item-id="<?php echo osc_item_id(); ?>" data-item-currency="<?php echo osc_item_currency(); ?>" data-ajax-url="<?php echo mo_ajax_url(); ?>&moAjaxOffer=1&itemId=<?php echo osc_item_id(); ?>"><?php _e('Submit your offer', 'delta'); ?></a>
<?php } ?>
</div>

For Mobile

<div class="basic isMobile">
<h1>
<?php if(del_check_category_price(osc_item_category_id())) { ?>
<div class="price mbCl3 p-<?php echo osc_item_price(); ?>x<?php if(osc_item_price() <= 0) { ?> isstring<?php } ?>"><?php echo osc_item_formated_price(); ?></div>
<?php } ?>

<?php echo osc_item_title(); ?>
</h1>

<?php if($make_offer_enabled) { ?>
<a href="#" id="mk-offer" class="make-offer-link" data-item-id="<?php echo osc_item_id(); ?>" data-item-currency="<?php echo osc_item_currency(); ?>" data-ajax-url="<?php echo mo_ajax_url(); ?>&moAjaxOffer=1&itemId=<?php echo osc_item_id(); ?>"><?php _e('Submit your offer', 'delta'); ?></a>
<?php } ?>
</div>

And I have remove code for mobile , and I have changed desktop code as below

<div class="basic">
<h1>
<?php if(del_check_category_price(osc_item_category_id())) { ?>
<div class="price mbCl3 p-<?php echo osc_item_price(); ?>x<?php if(osc_item_price() <= 0) { ?> isstring<?php } ?>"><?php echo osc_item_formated_price(); ?></div>
<?php } ?>

<?php echo osc_item_title(); ?>
</h1>



<?php if($make_offer_enabled) { ?>
<a href="#" id="mk-offer" class="make-offer-link" data-item-id="<?php echo osc_item_id(); ?>" data-item-currency="<?php echo osc_item_currency(); ?>" data-ajax-url="<?php echo mo_ajax_url(); ?>&moAjaxOffer=1&itemId=<?php echo osc_item_id(); ?>"><?php _e('Submit your offer', 'delta'); ?></a>
<?php } ?>
</div>



Now Its showing only one H1 Tag on each product.


Can you please check I have done right or wrong...
OwnPetz - Free Classified Ads. Buy, Sell or Adopt Online. https://ownpetz.com