Viewing 8 replies - 1 through 8 (of 8 total)
  • I’m guessing you mean main navigation menu. Ok, go to menu. Then make a custom menu (don’t forget to assign it to the correct location). Then look at categories. Check off the correct category and then add to menu. that should add the category to the menu.

    to have a category under a category then you’ll have to stagger it underneath. That means

    category one
    ___category two.

    Make sure it’s not right underneath but to the left. For the rest of the categories make sure they are right underneath the one above it.

    Thread Starter javaro_2405

    (@javaro_2405)

    thank rafa 1, but my main not menu, i want product on my homepage show the same this picture:

    https://i753.photobucket.com/albums/xx172/javaro_2405/upload.jpg

    can you help me?

    thank you very much.

    u have to assign home pase as your front page
    check in setting<<reading and set the page which u want

    Thread Starter javaro_2405

    (@javaro_2405)

    i try find it, but it not support, default it show all product of all category, but i want show product of one category.

    You need to get knowing WP_Query and The Loop.
    This is a simple loop, sorting Post by category:

    <?php
          $recent = new WP_Query("cat=5&showposts=8");
            while($recent->have_posts()) : $recent->the_post();?>
    
    <li><a href="<?php the_permalink() ?>" title="Permalink on <?php the_title_attribute(); ?>">
    <?php echo $post->post_title;?>
    <?php endwhile; wp_reset_postdata(); ?>

    where cat=5, is category id, and showposts=8 is number of posts. Instead of cat id you can use Category_name=blog.

    Not sure how your images are set.

    Thread Starter javaro_2405

    (@javaro_2405)

    thank for your help, but it show this pic:

    https://i753.photobucket.com/albums/xx172/javaro_2405/hinh015-6.jpg

    what’s the problem? can you tell me?

    Thread Starter javaro_2405

    (@javaro_2405)

    how to show it format grid?

    This is css, mate. Whole, pure, 100% natural css.

    What you need is to make HORIZONTAL list. As you might see, there is an opening tag for

    • all of a sudden in my code. You need to close
    • after <?php echo $post->post_title;?> as well as .

      Then, you need to go Listamatic and find out how to make a horizontal list. As far as I’m already there, ah, what the heck:

      HTML
       <div id="navcontainer">
       <ul id="navlist">
       <?php
            $recent = new WP_Query("cat=5&showposts=8");
              while($recent->have_posts()) : $recent->the_post();?>
      
       <li><a href="<?php the_permalink() ?>" title="Permalink on <?php the_title_attribute(); ?>">
      <?php echo $post->post_title;?></li></a>
      <?php endwhile; wp_reset_postdata(); ?>
      
       </ul>
       </div>
      
      CSS
       #navlist li
       {
       display: inline;
       list-style-type: none;
       padding-right: 20px;
       }
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to show product of category on homepage’ is closed to new replies.