- This topic has 26 replies, 5 voices, and was last updated 7 years, 8 months ago by Tom.
-
AuthorPosts
-
April 25, 2015 at 8:03 pm #102394Zoe
Hi there
I try page header addon on regular pages and it works perfectly. But it’s not working on WooCommerce pages such like – Shop, Cart and Checkout pages.
Is it possible to use page header addon function on pages created by WooCommerce?
April 25, 2015 at 8:44 pm #102397ZoeI test page header addon again on WooCommerce pages. It’s working on Cart and Checkout pages.
But not on Shop page.
April 25, 2015 at 11:46 pm #102444TomLead DeveloperLead DeveloperHi there,
WooCommerce unfortunately treats the Shop index page like the WordPress blog index page, thus ignoring any saved metabox values from editing that page – pretty frustrating.
There is a work-around if you’re willing to use GP Hooks though.
We can target the shop page using this conditional:
is_shop()
So, if you wanted to add an image below the header on the shop page, you would go into “Appearance > GP Hooks” and add something like this to the “After Header” hook:
<?php if ( function_exists( 'is_shop' ) ) : ?> <?php if ( is_shop() ) : ?> <div class="page-header-image grid-container grid-parent generate-page-header"><img src="THE URL TO YOUR IMAGE HERE" alt="" /></div> <?php endif; ?> <?php endif; ?>
If you need more info just let me know π
April 26, 2015 at 4:44 am #102475ZoeHi Tom
When I activate GP Hooks, it adds more queries (around 20 queries). It hurts page load time.
At Genesis, I always use “Genesis Simple Hooks”. Interesting – it doesn’t cause lots of queries like GP Hooks.
GP Hooks can achieve lots of things. Mesmerizing. That’s the steroid for GP. Impressive addon. I’d love to use it in heartbeat. That’s why I purchased GP Premium without thinking twice.
But I’m still worrying to use GP Hooks.
April 26, 2015 at 8:50 am #102508TomLead DeveloperLead DeveloperThose queries are the hooks being called on the page – I’m working on reducing them.
For now, go to “Appearance > GP Hooks” and hit the save button – it will reduce the amount of calls dramatically.
That being said, each of those queries are called in 0.0002 of a second – so you don’t really have to worry about them.
April 26, 2015 at 8:59 am #102511ZoeThanks Tom. I hope you achieve it soon. Appreciate for your suggestion.
I believe, in very near future, GP will definitely shake big ‘ol Genesis.
April 26, 2015 at 12:46 pm #102557TomLead DeveloperLead DeveloperLet me know if that suggestion works for you or not π
April 26, 2015 at 2:17 pm #102583ZoeYes. It works. Thank you so much Tom!
It’d be better if I don’t need to add HTML to get there. π But, hey, it just for Shop page only.
Please help me to check I’m doing right way.
Here’s what I add into “After Header” –
<?php if (function_exists( ‘is_shop’)): ?>
<?php if (is_shop()): ?><h2 style=”color: #fff; font-weight: bold; padding-bottom: 10px; padding-top: 30px; text-align: center;”>Welcome Blah Blah Blah…</h2><?php endif; ?>
<?php endif; ?>I took screenshot the result –
One more question. What do I have do if I want to add similar page header on “Single Product Page”?
April 26, 2015 at 11:25 pm #102645TomLead DeveloperLead DeveloperYea, it’s kind of a pain. It’s why I had to create the menu for the blog page header (Appearance > Blog Page Header). Of course, I can’t anticipate every plugin and add an area for it.
Your code got kind of jumbled, but by the looks of the screenshot it looks like it’s working.
As for the single product, you should find the Page Header metabox while editing those products.
Let me know π
April 27, 2015 at 4:58 am #102753ZoeThanks Tom.
Would it be possible to display “fluid container type” page header on single post?
April 27, 2015 at 8:24 am #102808TomLead DeveloperLead DeveloperAbsolutely – there should be a “Container type” option in the “Content” tab.
Let me know π
April 27, 2015 at 8:43 am #102814ZoeYep. I notice there is an option to choose between two container types.
But, the fluid container is not displaying under menu bar.
I took screenshot for you to look at it.
April 27, 2015 at 8:54 am #102820TomLead DeveloperLead DeveloperLooks like your Page Header location is set to display inside the content in “Appearance > Customize > Page Header”.
Let me know π
April 27, 2015 at 9:22 am #102825ZoeVoilaaaaa. YESSSS.
All is well!
I think I’m falling in love with GP. On the other hand, don’t want to leave Genesis.
Gosh. What should I do? You make me crazy. π I wish I didn’t meet GP two months ago.
April 27, 2015 at 9:24 am #102826TomLead DeveloperLead DeveloperHa! If there’s anything about Genesis you like that GP doesn’t have, definitely let me know π
-
AuthorPosts
- You must be logged in to reply to this topic.