Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Create Custom Post Loop Using Recently Popular Plugin Data WordPress


I need a custom post query loop made that will display posts with content of my choosing on my homepage on a separate tab.

At bottom you will find screenshots of all tables that need to be referenced in the query and a link to the WP resource for creating Custom post loop queries.

I want this new query to order the posts using the data that the "Recently Popular" wordpress plugin adds to the database.

It creates a table called wp_recently_popular so the new loop would need to query the posts and sort them in order of what is in the wp_recently_popular which contains data for 10 posts so it should allow me to have 10 posts too.

You'll notice that I also want to be able to have the post title, excerpt and a couple of custom fields so the loop has to allow me to do all that too.

This is what the normal loop looks.

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<div class="entry"></div><div class="entleft"><h3><a class="blink" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3><?php excerpt('20'); ?></div><div class="entright"><img src="<?php echo get_post_meta($post->ID, "answersource", true);?>" /><br /><a href="<?php echo get_post_meta($post->ID, "visitsite", true);?>"><?php echo get_post_meta($post->ID, "sitenames", true);?></a></div><p class="postmetadata"><small><?php wp_time_since(); ?> In <?php the_category(', ') ?> from <?php echo get_post_meta($post->ID, "thesite", true);?> <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('0 Answers »', '1 Ansert »', '% Answers »'); ?></small></p><div style="clear:both;"></div></div></div><?php endwhile; ?>


<strong>Custom Post Queries Reference</strong>

Answers (0)

No answers yet.