Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

http://joshing.org

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

WordPress custom post listing

// This pulls out posts from WordPress and displays them on a Page Template, along with some Custom Fields.

<?php
/*
Template Name: Offerings
*/

get_header(); ?>

        <div id="content" class="widecolumn">
                <div id="copy">
            <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                        <h1 id="post-"><?php the_title(); ?>h1>
                                Read the rest of this page »</p>'); ?>
                                '<p><strong>Pages:strong> ', '</p>', 'number'); ?>
                
                        'numberposts=50&category=1'); 
                           if($posts) : ?>
                                
                                        'revenue');
                                                $rev1 = trim($rev[0], "$");
                                                $rev2 = str_replace(",", "", $rev1);
                                                $revs[] = preg_replace('/(\w*?)?\d*/i', '', $rev2); /*stripsspace+words+space+digits*/
                                                $post_ids[] = $post->ID;
                                        endforeach;
                                
                                        $together = array_combine($post_ids, $revs);
                                        arsort($together);
                                        
                                        if($together) : foreach($together as $key => $value) : get_a_post($key); ?>                       
                                        
                                                >
                                                        
Description Location Revenue Earnings
</a>td> </td> <td><?php $rev = get_post_custom_values('revenue'); if($rev) { echo $rev[0]; } else { echo ' '; } ?>td> </td> tr> </table><br /> endif; ?> <?php endwhile; endif; ?> div>
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed