aleister
Forum Replies Created
-
Forum: Plugins
In reply to: If Post is Older than 60 days do this…Here is some code I found a while back (modified to work for you). It just has to be used within the loop of course.
<?php global $post; $postdate = str_replace("-", " ",substr($post->post_date, 0,10)); $postd = explode(" ", $postdate); $ageunix = (( time() - mktime('','','', $postd[1], $postd[2], $postd[0]))); $days_old = floor($ageunix/(24*60*60)); if ($days_old <= 60) { // do this } else { // do this } ?>
Forum: Plugins
In reply to: Is it possible to have a dropdown of posts in one particular category?Here you go ??
Forum: Plugins
In reply to: Is it possible to have a dropdown of posts in one particular category?That is a good idea for a little plugin – I will make it ??
Forum: Plugins
In reply to: Embed an MP3There are several available, some of which are listed here:
Forum: Plugins
In reply to: “Report this comment” pluginHere you go:
Forum: Plugins
In reply to: “Report this comment” pluginNot a bad idea ?? I will see what would be involved to make it.
Forum: Plugins
In reply to: Repositioning the more link?You can give it an empty parameter for the_content, like this:
the_content('')
So it does not display the link. Then in your meta area, add this:
<a href="<?php echo get_permalink(); ?>"> <?php the_title(); ?> </a>
Forum: Fixing WordPress
In reply to: Hide text?<span style="display:none;">text</span>
Although it would probably work better to find out where in the plugin it is displaying that information, and remove it completely.
Forum: Plugins
In reply to: Posted how long ago pluginI agree – his are quite nice ??
Forum: Plugins
In reply to: Graduated Post ListingsHandySolo: Because that would make too much sense ?? j/k
Good thinking ??
Forum: Plugins
In reply to: How would you write this queryNo problem ??
Forum: Plugins
In reply to: Graduated Post ListingsVisioGuy: You could do it with a single loop, by creating a counter that keeps track of what post is being displayed in the loop.
Something like this might work for you:
<?php $post_index = 0; ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <?php if ($post_index < 6) { ?> (show title, date, author, etc..) <?php the_content('Read the rest of this entry »'); ?> (show comment link and stuff) <?php } else if ($post_index < 11) { ?> (show the title) <?php get_the_content('Read the rest of this entry »'); ?> <?php } else { ?> (just show the title) <?php } ?> </div> <?php $post_index++; ?> <?php endwhile; ?>
Although for the shortened excerpt, that would need a small modification. Instead of using the_content, you can use get_the_content (which will return, but not echo the result). You could simply use the substr function to shorten it, but that will remove your ‘more’ link. Of course you could get it first from the string, shorten it, and re-add it back, but it just depends on how complicated you want to make it ??
Forum: Plugins
In reply to: How would you write this queryTry something like this:
global $wpdb; $tp = $wpdb->prefix; $results = (array)$wpdb->get_results(" SELECT ID, post_title FROM {$tp}posts WHERE post_mime_type = 'image/jpeg' ORDER BY post_title "); if (count($results) > 0) { echo '<ul>'; foreach ($results as $r) { echo '<a href="' . get_permalink($r->ID) . '">' . $r->post_title . '</a>'; } echo '</ul>'; }
(I just typed that out, so there may be bugs, etc.. but it should give you an idea at least)
Forum: Plugins
In reply to: Posted how long ago pluginForum: Plugins
In reply to: Help writing a simple pluginJust remember – do not use echo or print – append the text to the $content variable.