Any WordPress experts, Please Help me.
I am trying to display all posts in the drop-down menu, I get result 12 results of drop-down options, but another second page (I am using pagination) post is not shown in the drop down menu, when I go to the second page I show that page posts dropdown result. I want to show all posts in the dropdown menu on every page pages.
Code:-
<?php
wp_list_pages(array('post_type'=>'brands'));
?>
<select class="form-control pdt-category-select search-space" id="brands" name="brands">
<option>All</option>
<?php foreach ($posts as $post) {
echo '<option value="', $post->post_name, '"', $selected == $post->ID ? ' selected="selected"' : '', '>', $post->post_title, '</option>';
}?>
</select>