select dropdown list
-
Hello,
Can someone help me pls.
I have a page in wordpress where I want to display the content of a post (The title, the excerpt, the thumbnail and date).
I have this code below, that work. But I want this content change when I choose from an select box, with the categories of the posts. The select box must have the categories and after I choose an specific category a list of posts with (The title, the excerpt, the thumbnail and date) of that category should appear.
<?php $postslist = get_posts('category=4&numberposts=1&order=DESC&orderby=date'); foreach ($postslist as $post) : setup_postdata($post); ?> <?php echo get_the_post_thumbnail( $page->ID, array( 607, 370) ); ?> <?php foreach((get_the_category()) as $category){ echo "<p>".$category->name."<p>"; } ?> <?php the_title(); ?></a> <?php the_excerpt(__('(more…)')); ?> <?php endforeach; ?>
Thank you very much
Nuno Nascimento
- This topic was modified 3 years, 9 months ago by .
- This topic was modified 3 years, 9 months ago by .
- This topic was modified 3 years, 9 months ago by .
- This topic was modified 3 years, 9 months ago by .
- This topic was modified 3 years, 9 months ago by .
- This topic was modified 3 years, 9 months ago by .
- This topic was modified 3 years, 9 months ago by . Reason: please use CODE button for code formatting
- The topic ‘select dropdown list’ is closed to new replies.