how do I make it get posts alphabetically?
<form action="<? bloginfo('url'); ?>" method="get">
<select name="page_id" id="page_id">
$args = array( 'numberposts' => -1);
$posts = get_posts($args);
foreach( $posts as $post ) : setup_postdata($post); ?>
<option value="<? echo $post->ID; ?>"><?php the_title(); ?></option>
<?php endforeach; ?>
<input type="submit" name="submit" value="Cмотреть фильм" />
Thank you, where do I add this code? Also how do I change size of the form?
You add it after you define $posts via your get_posts() function, but before the beginning of the foreach() loop where you loop on it. (Which leaves you very little wiggle room. )
As far as size of the form, that sounds more like a HTML/CSS issue than a PHP question?
Thank you, it worked. I will check my CSS. Thanks
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)