Tagged: x
-
AuthorPosts
-
August 15, 2016 at 2:11 am #1131476
seungkim11ParticipantHello,
I am trying to modify ‘_landmark-header.php’ file
to edit this block:
<?php if ( x_is_shop() || x_is_product() ) : ?>
<h1 class=”h-landmark”><span> “CATEGORY NAME” </span></h1>
to put the actual category name of the product that belongs to (replacing “CATEGORY NAME”)
How can I grab the product’s category name here?
Please let me know. Thanks!
August 15, 2016 at 3:18 am #1131545
Paul RModeratorHi,
You can change that line of codes with this.
<?php if ( x_is_shop() || x_is_product() ) : global $post; $terms = get_the_terms( $post->ID, 'product_cat' ); if(isset($terms[0]->name) && !empty($terms[0]->name)): ?> <h1 class="h-landmark"><span><?php echo $terms[0]->name; ?></span></h1> <?php else:?> <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_shop_title' ); ?></span></h1> <?php endif; ?>Hope that helps.
August 15, 2016 at 5:38 am #1131686
seungkim11ParticipantWorked like a charm. Thank you very much!!!!!!!!!
One more question,
could you tell me how to add a banner between the navbar and the product/category header?
August 15, 2016 at 6:18 am #1131722
ThaiModeratorHi There,
Please add the following code under functions.php file locates in child theme:
add_action( 'x_before_view_renew__landmark-header', 'x_print_banners' ); function x_print_banners(){ ?> <a href="#"><img class="img-responsive" src="https://placeholdit.imgix.net/~text?txtsize=88&txt=1200%C3%97350&w=1200&h=350"></a> <?php }Hope it helps 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1131476 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
