WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
custom static image on shop page? (19 posts)

  1. RockitFX
    Member
    Posted 1 year ago #

    Hello,
    I am creating simple image banners on the top of each page of my site. I'd like to add an image to the top of the woocommerce shop page. How would I go about doing that? When I insert an image in the page edit screen, it does not appear. Do I need to add/edit php code?

    Thanks!

    http://wordpress.org/extend/plugins/woocommerce/

  2. Roy
    Member
    Posted 1 year ago #

    You can try using this hook -> woocommerce_before_shop_loop_item

    It is fired right before the products are looped.

  3. RockitFX
    Member
    Posted 1 year ago #

    i really don't know much about php code, I can edit it though. Could you explain a bit more what I would need to do? Thank you!

  4. Roy
    Member
    Posted 1 year ago #

    Here is a link on how to use action hooks. It will explain it better than I could and it has examples. http://codex.wordpress.org/Function_Reference/add_action

  5. bowenac
    Member
    Posted 1 year ago #

    UPDATE: looks like they removed that shortcode or maybe they never had it, just browse the pages you will see a page called shop. Add your image/banner to that page. I just tested this and it works fine, just make sure when you use the add media button that you also insert into page.

    Or if you want it somewhere specific just use css and add the class in your header.php where ever you want it to show up...
    <div class="banner"></div>

    Make your css classes for each page you want it to show up for called

    .woocommerce .banner{background: url(yoururl/Shop.jpg) no-repeat scroll center top transparent;}

    .blog .banner{background: url(yoururl/Blog.jpg) no-repeat scroll center top transparent;}

    .home .banner{background: url(yoururl/Home.jpg) no-repeat scroll center top transparent;}

    Now for each page check in firebug or chrometools but each page should have something unique in the body class most of the time the home page will have home in the body class so you can see how my example above would work. Hope this helps.

  6. RockitFX
    Member
    Posted 1 year ago #

    so something is different about my setup because when I add an image from my media library to the Woocomerce shop page (on the edit page screen) it does not appear.

  7. RockitFX
    Member
    Posted 1 year ago #

    also this hook language is way over my head, im a designer, not a coder :)

  8. bowenac
    Member
    Posted 1 year ago #

    It can take a min to show up... I would use the css method I explained though.

  9. bowenac
    Member
    Posted 1 year ago #

    If you are a designer you should know how to do this via css html...

    Or maybe you just meant graphic design. I can help you if you want... just message me. We can do a screen share if you would like.

  10. RockitFX
    Member
    Posted 1 year ago #

    graphic designer... sorry! Great ty!!!

  11. RockitFX
    Member
    Posted 1 year ago #

    Now i feel dumb, how do I message you on this site?

  12. bowenac
    Member
    Posted 1 year ago #

    Go to my website and send me an email from there, doesn't look like you can send PM's on here that's odd...
    here

  13. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    doesn't look like you can send PM's on here that's odd

    Why? There has never been a PM system on wordpress.org/support as these are community forums. All support takes place in public so that all members of the community benefit.

  14. bowenac
    Member
    Posted 1 year ago #

    It is weird because every single forum I have ever used... has an option to send a pm. What if I want to send someone my email, but yet don't want every single person who views this to have it...

  15. RockitFX
    Member
    Posted 1 year ago #

    I think I found a code-less work around for my situation. I created a new page, added my image, and used the woocomerece shortcode to show categories. It seems to work. I had to keep the woocomerce pages setting to have the Shop Base Page still direct to the original shop page. That setting seems to alter the way the page works because when I made my new page the shop base, it removed my image again.

  16. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    every single forum I have ever used... has an option to send a pm

    This is a community forum. PMs have absolutely no community benefit.

  17. bowenac
    Member
    Posted 1 year ago #

    Well I already posted a way to do what he would want to do, that is helping the next person who comes along...

    So since this is a community forum... how does one provide one on one support if they have no way of contacting one on one. Do you really think having a pm option would take away from the forum haha thats funny.

  18. ahsan73
    Member
    Posted 5 months ago #

    hy gyz plz help me.. how show woocommerce shop page in our custome main page

  19. klbc154
    Member
    Posted 3 months ago #

    UPDATE:

    //Check is_shop - Shop base page
            // if True then Show Category Header Content of The first Product in Shop base Page 
    
    if (is_shop()) {
            $args = array('taxonomy' => 'product_cat');
    		$product_categories = get_categories( $args  );
            $term_id = $product_categories[0]->term_id;
    		$content = get_term_meta($term_id, 'cat_meta');
            if(isset($content[0]['cat_header'])){
    			echo do_shortcode($content[0]['cat_header']);
    		}
    }
    ?>

    See my example kho hàng hóa

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.