Hi,
Interesting topic, I would be interested in your queries and how you show it 🙂
For the dropdown, how about something like this:
function casiepa_template_before_topics_loop() {
?>
<select name="menu1" id="menu1">
<option value="">Order by...</option>
<option value="http://www.example.com/?order=date">By date</option>
<option value="http://www.example.com/?order=pop">Nbr of Replies</option>
</select>
<script type="text/javascript">
var urlmenu = document.getElementById( 'menu1' );
urlmenu.onchange = function() {
window.open( this.options[ this.selectedIndex ].value );
};
</script>
<?php
};
add_action( 'bbp_template_before_topics_loop', 'casiepa_template_before_topics_loop', 10, 0 );
Hey, thank you so much for replying. I will try to use what you gave me here and see if I can get it to work. I will post what my loop-topics.php looks like in a bit so you can see what I did to try to get the dropdown to work. I do not really know php well so do not laugh… lol
What I originally had did everything I wanted, except it ignored all sticky posts and it was sorting everything as a normal topic, which is obviously not good.
Give me a few minutes and I will post my current loop-topics.php
I really appreciate the help, by the way 🙂
Ok, this is a dumb question but how do I paste source code here?…
If not too long, you can put it between backquotes.
So click the ‘code’ button (one but last button in the box where you type your reply), paste your code, then click that same button that will now be called ‘/code’
If it too long, paste it somewhere else like pastebin or github and just put a link.
Ok thanks for the explanation. I guess it was too long so it was not going through.
Here is my looptopics.php code. I got the filtering to work correctly, except a big problem is that it ignores sticky posts. It does not even grab the sticky css class so I definitely did something wrong.
http://pastebin.com/u4Ci0kYK
Thanks for the help
@casiepa, just wondering if you had a chance to look at my code.
Thanks
I had a quick look and it seems nice, but had no time yet to understand your sticky issue. I might only find time during next weekend, sorry.