Home Forums Basel support forum i want to display category title where single product page

i want to display category title where single product page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2045

    socialbean
    Participant

    current :

    and want :

    i catch that relate source in
    wp-content\themes\basel\woocommerce\content-single-product.php
    wp-content\themes\basel\inc\template-tags.php

    and try modify file. but i failed..

    how do i get wish result?

    #2048

    Artem Temos
    Keymaster

    Hello there,

    Thank you for your question.

    Try to add the following code to your child theme functions.php to display categories menu on the product page

    add_action( 'wp', 'basel_page_title_single_init', 18 );
    
    function basel_page_title_single_init() {
    	add_action( 'basel_after_header', 'basel_page_title_single', 11 );
    }
    function basel_page_title_single() {
        global $wp_query, $post;
        if( ! is_singular( 'product' ) ) return;
    
    	$style = '';
    
    	$page_for_posts    = get_option( 'page_for_posts' );
    	$page_for_shop     = get_option( 'woocommerce_shop_page_id' );
    	$page_for_projects = basel_tpl2id( 'portfolio.php' );
    
    	$title_class = 'page-title-';
    
    	$title_color = $title_type = $title_size = 'default';
    
    	// Get default styles from Options Panel
    	$title_design = basel_get_opt( 'page-title-design' );
    
    	$title_size = basel_get_opt( 'page-title-size' );
    
    	$title_color = basel_get_opt( 'page-title-color' );
    
    	$title_class .= $title_type;
    	$title_class .= ' title-size-'  . $title_size;
    	$title_class .= ' color-scheme-' . $title_color;
    	$title_class .= ' title-design-' . $title_design;
    
    ?>
    	<div class="page-title <?php echo esc_attr( $title_class ); ?> title-shop" style="<?php echo esc_attr( $style ); ?>">
    		<div class="container">
    			<div class="nav-shop">
    				<?php basel_product_categories_nav(); ?>
    
    			</div>
    		</div>
    	</div>
    <?php
    }
    #2050

    socialbean
    Participant

    that’s right!

    thank you!

    #2059

    Artem Temos
    Keymaster

    You are welcome, write us when you have any difficulties or issues with our theme.

    And we would be glad if you will rate our theme with 5 stars on themeforest in case you are satisfied with our theme and customer service http://themeforest.net/downloads

    Thank you in advance 🙂

Tagged: ,

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘i want to display category title where single product page’ is closed to new replies.