Support » Themes and Templates » Posttypes, loop

  • bjornesjo


    Hello, I would like to know how I can use WordPress loop to display some of my posts in a certain way in a div box. For example my recent posts from a certain category, as shown.

    How can I do to add advanced search, using post types or category?
    for example, just search for posts (food) where the food takes only 30 minutes to prepare.

    I guess it’s pretty much to learn, but perhaps you could explain a bit and unless otherwise refer to what I should learn.


Viewing 2 replies - 1 through 2 (of 2 total)
  • Digest WP



    Filter WordPress loop like this

    <?php query_posts('category_name=wordpress&showposts=5'); ?>
    <?php while (have_posts()) : the_post(); ?>
            <li><a href="<?php the_permalink(); ?>">
              <?php the_title(); ?>
              </a>  </li>
            <?php endwhile; ?>

    This will help you with the category search

    <form method="get" id="searchform" action="">
    <input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id=s>
    <input type="submit" id="searchsubmit" value="Search My Special Cat">


    First, thanks for the first answer! 😀

    Okey, not shore i understod all of it. But is the code for this purpose:

    lets say i have post with each 5 differant “tags” (30 min, sallads, fastfood,) Then i want a search function with radiobuttons.

    So if I search for pizza and toggle the fastfood radiobutton I only see results of pizza who has the tag fastfood.

    You get what i mean?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Posttypes, loop’ is closed to new replies.