Alphabetical order Plugin for WordPress theme?
December 20th, 2013
I just want to be able to have an option to have all my posts (movies) in Alphabetical order in my blog for MP4 movies
http://www.freemp4movies.info
I tried google (of course) & wordpress forums, most people just suggesting creat category, which is rather lame & illogical because I am still posting movies every week & it will be impossible to keep up..
so any plugin that can allow me to have them in Alphabetical order would be great.
Hi aftms, You’ve got a couple options, hopefully one works well for you…
Modify Your Theme File
You can open your theme file (index.php) and add the following code. This will sort your posts in alphabetical order all the time, which seems to make sense for you. If you want to add conditional code to sort the posts into alphabetical order only when certain conditions are met (e.g. only if you’re on the homepage or only if it’s an archive), you can ping me and I’ll add that code. Here goes basic sorting though:
// display posts organized by title in ascending order
<?php $posts = query_posts( $query_string . '&orderby=title&order=asc' ); ?>
<?php if( $posts ) : ?>
<div class="post">
<h1>Ordered by Post Title (Ascending)</h1>
<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<p><?php the_content(); ?></p>
<?php endforeach; ?>
</div>
A Plugin (Doesn’t look like a perfect match, but perhaps helpful.)
Haven’t ever tried this before, but it might be helpful. This plugin uses custom fields to let you add a sort bar to your WordPress front end:
http://www.dyasonhat.com/wordpress-plugins/smart-sort-wordpress-plugin-sort-posts-by-custom-field/