how to change template?

you could use this snippet, and modify the output string accordingly. $categories = get_the_category(); $separator=” “; $output=””; if ( ! empty( $categories ) ) { foreach( $categories as $category ) { $output .= ‘<a href=”‘ . esc_url( get_category_link( $category->term_id ) ) . ‘” alt=”‘ . esc_attr( sprintf( __( ‘View all posts in %s’, ‘textdomain’ ), … Read more

Display Slug instead of Name

From your code, it looks like product_cat is a custom taxonomy. get_the_terms returns an array you can get the slug from. For instance… $terms_array = get_the_terms($post->ID, ‘procuct_cat’); $term_slug = $terms_array[‘your index’]->slug;

Nav menu category links not showing

A wp_nav_menu is a manually created menu – WordPress doesn’t create it for you. If you want to keep using this function, you can go to either Appearance > Menus or Appearance > Customize > Menus, add links to the menu, and check the “primary” theme location under Display Location. However – if you’re just … Read more

I need to create a search form that will display search results from specific category

You can use WP_query() to narrow down the results of your search: <?php $args = array( ‘s’ => $_GET[‘s’], ‘post_type’ => array( ‘post’, ‘page’ ), ‘post_status’ => ‘publish’, ‘category_name’ => ‘music’, ‘posts_per_page’ => -1 ); $custom_search = new WP_Query( $args ); if ( $custom_search->have_posts() ) { while ( $custom_search->have_posts() ) : $custom_search->the_post(); ?> <div class=”entry-content”> … Read more

editing fonts of category links from the_category() funtion

If you are using the_category() (so without passing parameters), the result will be something like: <ul class=”post-categories”> <li><a href=”https://wordpress.stackexchange.com/questions/262546/cat1″>Category 1</a><li> <li><a href=”http://wordpress.stackexchange.com/cat2″>Category 2</a><li> </ul> So a css line like .post-categories li a {font-family:Myfont;} should do it. Reference: the_category() calls get_the_category_list, which does the actual output. This function ends with a filter, which you could use … Read more

How Can I Display Categories Description

From the category_description( $category_id ) parameters description: Category ID. Will use global category ID by default. This means that if you are intending to use the global id, you don’t need to insert the variable $category_id which may be undefined in your use of the function. I’m assuming it is undefined because it is not … Read more