PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, March 12, 2022

[FIXED] Add a DIV in Woocommerce Shop Page only

 March 12, 2022     html, php, templates, woocommerce, wordpress     No comments   

Issue

I'd like to add a DIV under the title of my Shop page, but ONLY my main shop page. I added some code in " archive-product.php " but then it display the code on every shop page.

In fact i just need a DIV saying " choose a category below " on the main Shop Page.

Thnaks a lot for your help! Vince


Solution

You can add that div conditionally like the following and then the div will be shown only on shop page

if ( is_shop() ) {
    echo '<div>Choose a category below</div>';
}


Answered By - obiPlabon
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing