Global Block on shop and archive

Hi guys,

I would like to put a global block that contains a background image and a text in the top section of the shop page and on the archive page, would that be doable? if so, how?.

i tried adding it through functions.php but the entire global block sort of broke. this is the code i wrote:

/*	function shop_header() { 
 if ( is_shop() || is_product_category() ) : ?>
		<div class="x-header-shop">
		    <h1 class="shop-header"><span><?php echo do_shortcode('[cs_gb id=6611]'); ?></span></h1>
		</div>
<?php endif; 
}
add_action('x_after_masthead_end','shop_header', 30); */

This was the result: http://prntscr.com/jomgdn

this is what was supposed to show: http://prntscr.com/jomgp3

is there any way to do so?

Hi There,

I’ve changed your code to this:

function shop_header() { 
 if ( is_shop() || is_product_category() ) : ?>
		<div class="x-header-shop">
		    <?php echo do_shortcode('[cs_gb id=6611]'); ?>
		</div>
<?php endif; 
}
add_action('x_after_masthead_end','shop_header', 30);

It looks good now.

Cheers!

I just re-read my thread and realized what an atrocity i wrote before (wrapping the block inside an H1 tag was already bad enough, add a span to the mix and you get what i got.)

thanks man, you rock!

You are most welcome. :slight_smile:

Just one last question:

Where can i find a list of all the PRO and theme X hooks? i also wanted to add a global block at the bottom of the page, right before the footer but what stops me is the hook i need to use, would you mind giving me a hand? i don’t need the code, i just need a list of hooks or a knowledgebase page with the right information on it (that will also allow me to work on my own without having to ask you every time)

Thanks in advance.

Hey There,

Regretfully we do not have a complete lists of the hooks and filters for X and Pro. You may check out this knowledge base article for a particle list: https://theme.co/apex/forum/t/customizations-actions-and-filters-in-x-pro/208

If you want something more custom, you might need to inspect each of the theme files and find if there are available hooks or filters for your specific needs.

Thank you.

Thank you very much!

You are most welcome!