ThemeShaper Forums » Thematic

[closed]

add text with function only to certain category WooCommerce

(2 posts)
  • Started 2 years ago by mrmikeman
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. mrmikeman
    Member

    Im making a site with WooCommerce and Thematic, i always get stuck on adding functions/hooks...

    I need to add text on top of my Shop page/ Home page as well as different text on top of Category pages but all different text.. i know this can be done with some conditional statements.. but even using the wp codex things dont seem to want to work

    this is my current code

    function home_content()
    {
         echo '<strong>My Text Here';
    }
    
    add_action('woocommerce_before_shop_loop_item_title', 'home_content');

    maybe the reson i couldnt do it is cause, is_home which i used before, is not right since my Home is actually my "shop" according to WooCommerce...

    could someone wrap that code for me conditionally for the home/shop and category pages?

    Thank you!

    Posted 2 years ago #
  2. 1. please note that thematic has moved to www.thematictheme.com and all future questions should be posted there.

    2. i can't really see how this is a thematic question since you are adding content to a woocommcerce hook and wondering about wordpress conditional logic, but i suggest looking in the woocommerce docu for conditional / template tags... i want to say is_shop() exists()

    is_home() actually refers to your BLOG home.

    is_front_page() is always the front page.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.