Home Forums WoodMart support forum Categories dosent showup

Categories dosent showup

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #141138

    kimitshah
    Participant

    i have add new categories in products > categories. that dosent show-up on category list (Right side of searchbar) and also in category menu. can you please guide how to get rid of this problem

    #141142

    Eric Watson
    Participant

    Hello,

    Categories do not automatically appear in the menu, you need to go in Appearance -> Menu and add them yourself.

    http://prntscr.com/oz6q9s

    Kind Regards
    XTemos Studio

    #141144

    kimitshah
    Participant

    i have added all the categories. but that dosent show up in category list to the search in header
    How do i solve this problem

    Attachments:
    You must be logged in to view attached files.
    #141151

    Eric Watson
    Participant

    By default, categories are shown in which there are products and empty ones are hidden, we can give you a custom code to show all categories.

    Kind Regards
    XTemos Studio

    #141152

    kimitshah
    Participant

    yes please if you can help me to get rid of it

    #141156

    Eric Watson
    Participant

    Try to add the following PHP code snippet to the child theme functions.php file to do this

    function woodmart_show_categories_dropdown() {
    		$args = array( 
    			'hide_empty' => 0,
    			'parent' => 0
    		);
    		$terms = get_terms('product_cat', $args);
    		if( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
    			?>
    			<div class="search-by-category input-dropdown">
    				<div class="input-dropdown-inner woodmart-scroll-content">
    					<input type="hidden" name="product_cat" value="0">
    					<a href="#" data-val="0"><?php esc_html_e('Select category', 'woodmart'); ?></a>
    					<div class="list-wrapper woodmart-scroll">
    						<ul class="woodmart-scroll-content">
    							<li style="display:none;"><a href="#" data-val="0"><?php esc_html_e('Select category', 'woodmart'); ?></a></li>
    							<?php
    								if( ! apply_filters( 'woodmart_show_only_parent_categories_dropdown', false ) ) {
    							        $args = array(
    							            'title_li' => false,
    										'taxonomy' => 'product_cat',
    										'use_desc_for_title' => false,
    							            'walker' => new WOODMART_Custom_Walker_Category(),
    							        );
    							        wp_list_categories($args);
    								} else {
    								    foreach ( $terms as $term ) {
    								    	?>
    											<li><a href="#" data-val="<?php echo esc_attr( $term->slug ); ?>"><?php echo esc_attr( $term->name ); ?></a></li>
    								    	<?php
    								    }
    								}
    							?>
    						</ul>
    					</div>
    				</div>
    			</div>
    			<?php
    		}
    	}

    Kind Regards
    XTemos Studio

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